diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-27 23:46:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-27 23:46:15 (GMT) |
commit | 7322ff15614fb3f25eae565f00f9beaf62f71314 (patch) | |
tree | 57104d62bee7664c5aece87d39d2936aa7c864e9 | |
parent | d58ebf073c755c2f0f6e4ef2296b48a4c75e5f1c (diff) | |
download | cpython-7322ff15614fb3f25eae565f00f9beaf62f71314.zip cpython-7322ff15614fb3f25eae565f00f9beaf62f71314.tar.gz cpython-7322ff15614fb3f25eae565f00f9beaf62f71314.tar.bz2 |
[3.13] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119486)
gh-119317: findall instead of traverse for docutils nodes (GH-119319)
(cherry picked from commit 0867bce45768454ee31bee95ca33fdc2c9d8b0fa)
Co-authored-by: Carlos Meza <hire@carlosmeza.com>
-rw-r--r-- | Doc/tools/extensions/glossary_search.py | 4 | ||||
-rw-r--r-- | Doc/tools/extensions/pyspecific.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Doc/tools/extensions/glossary_search.py b/Doc/tools/extensions/glossary_search.py index 2327820..7c93b1e 100644 --- a/Doc/tools/extensions/glossary_search.py +++ b/Doc/tools/extensions/glossary_search.py @@ -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] diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index b35bedc..7a2a853 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -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) |