mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix autodoc for some conditions where env.autodoc_* is not set.
This commit is contained in:
parent
5d253d4293
commit
d739756f2a
@ -52,19 +52,19 @@ def generate_rst(what, name, members, undoc, add_content,
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user