mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119487)
gh-119317: findall instead of traverse for docutils nodes (GH-119319)
(cherry picked from commit 0867bce457
)
Co-authored-by: Carlos Meza <hire@carlosmeza.com>
This commit is contained in:
parent
122dd4f48a
commit
2b091b9aa9
2 changed files with 4 additions and 4 deletions
|
@ -25,8 +25,8 @@ def process_glossary_nodes(app, doctree, fromdocname):
|
||||||
|
|
||||||
terms = {}
|
terms = {}
|
||||||
|
|
||||||
for node in doctree.traverse(glossary):
|
for node in doctree.findall(glossary):
|
||||||
for glossary_item in node.traverse(definition_list_item):
|
for glossary_item in node.findall(definition_list_item):
|
||||||
term = glossary_item[0].astext().lower()
|
term = glossary_item[0].astext().lower()
|
||||||
definition = glossary_item[1]
|
definition = glossary_item[1]
|
||||||
|
|
||||||
|
|
|
@ -604,7 +604,7 @@ def parse_monitoring_event(env, sig, signode):
|
||||||
|
|
||||||
|
|
||||||
def process_audit_events(app, doctree, fromdocname):
|
def process_audit_events(app, doctree, fromdocname):
|
||||||
for node in doctree.traverse(audit_event_list):
|
for node in doctree.findall(audit_event_list):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
@ -663,7 +663,7 @@ def process_audit_events(app, doctree, fromdocname):
|
||||||
|
|
||||||
body += row
|
body += row
|
||||||
|
|
||||||
for node in doctree.traverse(audit_event_list):
|
for node in doctree.findall(audit_event_list):
|
||||||
node.replace_self(table)
|
node.replace_self(table)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue