Commit a1e81657 authored by Aurel's avatar Aurel

this try/except must only catch error from the getattr, not from

script execution
parent 414042ad
...@@ -86,12 +86,13 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin, ...@@ -86,12 +86,13 @@ class TextDocument(CachedConvertableMixin, BaseConvertableFileMixin,
method_id = self.getTextContentSubstitutionMappingMethodId() method_id = self.getTextContentSubstitutionMappingMethodId()
if method_id: if method_id:
try: try:
mapping = guarded_getattr(self, method_id)(**kw) method = guarded_getattr(self, method_id)
except AttributeError: except AttributeError:
LOG('TextDocument', WARNING, 'could not get the substitution' LOG('TextDocument', WARNING, 'could not get the substitution'
' mapping method %s from %r, so the content will not be' ' mapping method %s from %r, so the content will not be'
' substituted.' % (method_id, self.getRelativeUrl())) ' substituted.' % (method_id, self.getRelativeUrl()))
return text return text
mapping = method(**kw)
is_str = isinstance(text, str) is_str = isinstance(text, str)
if is_str: if is_str:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment