]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119487)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 24 May 2024 02:12:23 +0000 (04:12 +0200)
committerGitHub <noreply@github.com>
Fri, 24 May 2024 02:12:23 +0000 (02:12 +0000)
gh-119317: findall instead of traverse for docutils nodes (GH-119319)
(cherry picked from commit 0867bce45768454ee31bee95ca33fdc2c9d8b0fa)

Co-authored-by: Carlos Meza <hire@carlosmeza.com>
Doc/tools/extensions/glossary_search.py
Doc/tools/extensions/pyspecific.py

index 232782093926f62058632fc06b5a050cac00ec73..7c93b1e4990603e8ba7714bfb8503e72ec9e8ad6 100644 (file)
@@ -25,8 +25,8 @@ def process_glossary_nodes(app, doctree, fromdocname):
 
     terms = {}
 
-    for node in doctree.traverse(glossary):
-        for glossary_item in node.traverse(definition_list_item):
+    for node in doctree.findall(glossary):
+        for glossary_item in node.findall(definition_list_item):
             term = glossary_item[0].astext().lower()
             definition = glossary_item[1]
 
index 47a245f768f557e0bf0f6f895a4e7d77fee8b5a8..caf145997fa9966b5142fe28981bc293cf9f0afd 100644 (file)
@@ -604,7 +604,7 @@ def parse_monitoring_event(env, sig, signode):
 
 
 def process_audit_events(app, doctree, fromdocname):
-    for node in doctree.traverse(audit_event_list):
+    for node in doctree.findall(audit_event_list):
         break
     else:
         return
@@ -663,7 +663,7 @@ def process_audit_events(app, doctree, fromdocname):
 
         body += row
 
-    for node in doctree.traverse(audit_event_list):
+    for node in doctree.findall(audit_event_list):
         node.replace_self(table)