From cfc56329d4453c37bc3d0b8e7ea8813c10e1a7c6 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 22 Jul 2018 01:50:09 +0900 Subject: [PATCH] Fix #344: autosummary does not understand docstring of module level attributes --- CHANGES | 1 + sphinx/ext/autodoc/__init__.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index e57a0dad6..92475536c 100644 --- a/CHANGES +++ b/CHANGES @@ -174,6 +174,7 @@ Bugs fixed * #5132: (lualatex) PDF build fails if indexed word starts with Unicode character * #5133: latex: index headings "Symbols" and "Numbers" not internationalized * #5114: sphinx-build: Handle errors on scanning documents +* #344: autosummary does not understand docstring of module level attributes Testing -------- diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index 62143fda4..4a9b59537 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1265,6 +1265,11 @@ class DataDocumenter(ModuleLevelDocumenter): # type: (bool) -> None pass + def get_real_modname(self): + # type: () -> str + return self.get_attr(self.parent or self.object, '__module__', None) \ + or self.modname + class MethodDocumenter(DocstringSignatureMixin, ClassLevelDocumenter): # type: ignore """