Commits

georg.brandl  committed ac38f07

Fix autodoc for some conditions where env.autodoc_* is not set.

  • Participants
  • Parent commits 985d62e

Comments (0)

Files changed (1)

File sphinx/ext/autodoc.py

         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