From 231202626c276a5516fd94b865b4de186d14a70d Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Tue, 21 May 2024 09:07:43 -0700 Subject: [PATCH] findall instead of traverse for docutils nodes closes #119317 --- Doc/requirements.txt | 2 +- Doc/tools/extensions/glossary_search.py | 4 ++-- Doc/tools/extensions/pyspecific.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/requirements.txt b/Doc/requirements.txt index 15675ab45fea713..25f4bc876001e37 100644 --- a/Doc/requirements.txt +++ b/Doc/requirements.txt @@ -12,7 +12,7 @@ blurb sphinx-autobuild sphinxext-opengraph==0.7.5 -sphinx-notfound-page==1.0.0 +sphinx-notfound-page==1.0.1 # The theme used by the documentation is stored separately, so we need # to install that as well. diff --git a/Doc/tools/extensions/glossary_search.py b/Doc/tools/extensions/glossary_search.py index 232782093926f62..7c93b1e4990603e 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 44db77af5d24d36..8b592d4b4adcea7 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)