Skip to content

Commit c4458e3

Browse files
committed
ifconfig: Do not use a meta node for noop
1 parent 9fad9d9 commit c4458e3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sphinx/ext/ifconfig.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from docutils.nodes import Node
2121

2222
import sphinx
23-
from sphinx import addnodes
2423
from sphinx.application import Sphinx
2524
from sphinx.util.docutils import SphinxDirective
2625
from sphinx.util.nodes import nested_parse_with_titles
@@ -52,7 +51,7 @@ def process_ifconfig_nodes(app: Sphinx, doctree: nodes.document, docname: str) -
5251
ns = {confval.name: confval.value for confval in app.config}
5352
ns.update(app.config.__dict__.copy())
5453
ns['builder'] = app.builder.name
55-
for node in doctree.findall(ifconfig):
54+
for node in list(doctree.findall(ifconfig)):
5655
try:
5756
res = eval(node['expr'], ns)
5857
except Exception as err:
@@ -65,7 +64,7 @@ def process_ifconfig_nodes(app: Sphinx, doctree: nodes.document, docname: str) -
6564
node.replace_self(newnode)
6665
else:
6766
if not res:
68-
node.replace_self(addnodes.meta())
67+
node.replace_self([])
6968
else:
7069
node.replace_self(node.children)
7170

0 commit comments

Comments
 (0)