[Python-checkins] r61417 - doctools/trunk/sphinx/ext/autodoc.py

georg.brandl python-checkins at python.org
Sun Mar 16 12:10:31 CET 2008


Author: georg.brandl
Date: Sun Mar 16 12:10:31 2008
New Revision: 61417

Modified:
   doctools/trunk/sphinx/ext/autodoc.py
Log:
Fix autodoc for some conditions where env.autodoc_* is not set.


Modified: doctools/trunk/sphinx/ext/autodoc.py
==============================================================================
--- doctools/trunk/sphinx/ext/autodoc.py	(original)
+++ doctools/trunk/sphinx/ext/autodoc.py	Sun Mar 16 12:10:31 2008
@@ -52,19 +52,19 @@
         objpath = []
     elif what in ('class', 'exception', 'function'):
         mod, obj = rpartition(name, '.')
-        if not mod:
+        if not mod and hasattr(env, 'autodoc_current_module'):
             mod = env.autodoc_current_module
         if not mod:
             mod = env.currmodule
         objpath = [obj]
     else:
         mod_cls, obj = rpartition(name, '.')
-        if not mod_cls:
+        if not mod_cls and hasattr(env, 'autodoc_current_class'):
             mod_cls = env.autodoc_current_class
         if not mod_cls:
             mod_cls = env.currclass
         mod, cls = rpartition(mod_cls, '.')
-        if not mod:
+        if not mod and hasattr(env, 'autodoc_current_module'):
             mod = env.autodoc_current_module
         if not mod:
             mod = env.currmodule


More information about the Python-checkins mailing list