Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2022-05-07 16:07:45 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2022-05-07 16:07:45 +0300
commitd7c1f6ed68445c02e6c44bdb5841bf3855715a2b (patch)
tree0832ec8c09b5b4a0be02b33c6b35f05ef7f23850
parentae96a3ea85d714d42b67df603ce7c747d28ceaa0 (diff)
autosummary: global variables having doc-comment are considered as non-imported members of the module
-rw-r--r--sphinx/ext/autosummary/generate.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py
index feef821c4..5ef7b0352 100644
--- a/sphinx/ext/autosummary/generate.py
+++ b/sphinx/ext/autosummary/generate.py
@@ -168,10 +168,12 @@ class ModuleScanner:
continue
try:
- if inspect.ismodule(value):
+ if ('', name) in attr_docs:
+ imported = False
+ elif inspect.ismodule(value):
imported = True
elif safe_getattr(value, '__module__') != self.object.__name__:
- imported = objtype != 'data' or ('', name) not in attr_docs
+ imported = True
else:
imported = False
except AttributeError: