summaryrefslogtreecommitdiff
path: root/sphinx/domains/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r--sphinx/domains/python.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
index 6a6c447b5..8bf3ceff6 100644
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -1007,7 +1007,7 @@ class PyModule(SphinxDirective):
content_node.document = self.state.document
nested_parse_with_titles(self.state, self.content, content_node)
- ret: List[Node] = [*content_node.children]
+ ret: List[Node] = []
if not noindex:
# note module to the domain
node_id = make_id(self.env, self.state.document, 'module', modname)
@@ -1028,6 +1028,7 @@ class PyModule(SphinxDirective):
indextext = '%s; %s' % (pairindextypes['module'], modname)
inode = addnodes.index(entries=[('pair', indextext, node_id, '', None)])
ret.append(inode)
+ ret.extend(content_node.children)
return ret
def make_old_id(self, name: str) -> str: