Menu

Commit [r6617]  Maximize  Restore  History

Move docutils imports at the toplevel, as it seems that imports in methods can be problematic in some cases (e.g. see #4280).

In this specific case, the error seen was:
{{{
2008-02-27 10:10:29,405 Trac[api] WARNING: HTML preview using <trac.mimeview.rst.ReStructuredTextRenderer object at 0xb9debdac> failed ('module' object has no attribute 'directives')
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/Trac-0.11b1-py2.5.egg/trac/mimeview/api.py", line 630, in render
rendered_content, filename, url)
File "/usr/lib/python2.5/site-packages/Trac-0.11b1-py2.5.egg/trac/mimeview/rst.py", line 142, in render
rst.directives.register_directive('trac', trac)
AttributeError: 'module' object has no attribute 'directives'
}}}

Thanks to H. Turgut Uyar for reporting the issue and testing the fix.

cboos 2008-02-27

changed /trunk/trac/mimeview/rst.py
/trunk/trac/mimeview/rst.py Diff Switch to side-by-side view
Loading...