summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>2023-05-08 19:01:25 (GMT)
committerGitHub <noreply@github.com>2023-05-08 19:01:25 (GMT)
commit942482c8e660765f68098eae347d84b93e37661a (patch)
tree0eb0489191df3b1d5f735780056c3204cf23536a /Doc
parent9af485436b83003b5705a6e54bdeb900c70e0c69 (diff)
downloadcpython-942482c8e660765f68098eae347d84b93e37661a.zip
cpython-942482c8e660765f68098eae347d84b93e37661a.tar.gz
cpython-942482c8e660765f68098eae347d84b93e37661a.tar.bz2
GH-104284: Fix documentation gettext build (#104296)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tools/extensions/pyspecific.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index 4fe54e3..cd8d9fe 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -674,7 +674,14 @@ def process_audit_events(app, doctree, fromdocname):
node.replace_self(table)
-def patch_pairindextypes(app) -> None:
+def patch_pairindextypes(app, _env) -> None:
+ """Remove all entries from ``pairindextypes`` before writing POT files.
+
+ We want to run this just before writing output files, as the check to
+ circumvent is in ``I18nBuilder.write_doc()``.
+ As such, we link this to ``env-check-consistency``, even though it has
+ nothing to do with the environment consistency check.
+ """
if app.builder.name != 'gettext':
return
@@ -688,14 +695,7 @@ def patch_pairindextypes(app) -> None:
# the Sphinx-translated pairindextypes values. As we intend to move
# away from this, we need Sphinx to believe that these values don't
# exist, by deleting them when using the gettext builder.
-
- pairindextypes.pop('module', None)
- pairindextypes.pop('keyword', None)
- pairindextypes.pop('operator', None)
- pairindextypes.pop('object', None)
- pairindextypes.pop('exception', None)
- pairindextypes.pop('statement', None)
- pairindextypes.pop('builtin', None)
+ pairindextypes.clear()
def setup(app):
@@ -719,7 +719,7 @@ def setup(app):
app.add_directive_to_domain('py', 'awaitablemethod', PyAwaitableMethod)
app.add_directive_to_domain('py', 'abstractmethod', PyAbstractMethod)
app.add_directive('miscnews', MiscNews)
- app.connect('builder-inited', patch_pairindextypes)
+ app.connect('env-check-consistency', patch_pairindextypes)
app.connect('doctree-resolved', process_audit_events)
app.connect('env-merge-info', audit_events_merge)
app.connect('env-purge-doc', audit_events_purge)