|
ticket id 000042 |
status closed |
priority ??? |
assigned to Waylan |
Reported by: eichin@gmail.com Component: |
Markdown.registerExtensions has this code:
try:
ext.extendMarkdown(self, globals())
except AttributeError:
message(ERROR, "Incorrect type! Extension '%s' is "
"neither a string or an Extension." %(repr(ext)))
I just got confused by it, because I'd written md.preprocessor.add instead of md.preprocessors.add, and got the traceback pointing somewhere else entirely... it's not much for style, but a correct fix would be
try:
ext.extendMarkdown
except AttributeError:
message(ERROR, "Incorrect type! Extension '%s' is "
"neither a string or an Extension." %(repr(ext)))
ext.extendMarkdown(self, globals())
so that the attribute check only applies to the specific local attribute. (Using hasattr is probably a lot clearer... parsing the AttributeError exception message is impractical.)
Resolution
fixed