From e812dd9f7acf7ffdd4143b7610537dd7d7476c73 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Sat, 13 Apr 2024 11:27:36 +0200 Subject: [PATCH] intersphinx, fixup of d3c41f --- sphinx/ext/intersphinx.py | 4 ++-- tests/test_extensions/test_ext_intersphinx.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py index f6d4a4e5fe9..93165a1d723 100644 --- a/sphinx/ext/intersphinx.py +++ b/sphinx/ext/intersphinx.py @@ -61,7 +61,7 @@ logger = logging.getLogger(__name__) -def process_disabled_reftypes(env: BuildEnvironment) -> None: +def _process_disabled_reftypes(env: BuildEnvironment) -> None: # Compile intersphinx_disabled_reftypes into datastructures # easier to check during reference resolution. # It is a separate function so the tests can use it. @@ -87,7 +87,7 @@ def __init__(self, env: BuildEnvironment) -> None: self.env = env if not hasattr(env, 'intersphinx_cache'): - process_disabled_reftypes(env) + _process_disabled_reftypes(env) # initial storage when fetching inventories before processing self.env.intersphinx_cache = {} # type: ignore[attr-defined] diff --git a/tests/test_extensions/test_ext_intersphinx.py b/tests/test_extensions/test_ext_intersphinx.py index 81259f1f34e..871a1c81618 100644 --- a/tests/test_extensions/test_ext_intersphinx.py +++ b/tests/test_extensions/test_ext_intersphinx.py @@ -17,7 +17,7 @@ load_mappings, missing_reference, normalize_intersphinx_mapping, - process_disabled_reftypes, + _process_disabled_reftypes, ) from sphinx.ext.intersphinx import setup as intersphinx_setup from sphinx.util.console import strip_colors @@ -46,7 +46,7 @@ def set_config(app, mapping): app.config.intersphinx_mapping = mapping app.config.intersphinx_cache_limit = 0 app.config.intersphinx_disabled_reftypes = [] - process_disabled_reftypes(app.env) + _process_disabled_reftypes(app.env) @mock.patch('sphinx.ext.intersphinx.InventoryFile') @@ -398,22 +398,22 @@ def assert_(rn, expected): # the base case, everything should resolve assert app.config.intersphinx_disabled_reftypes == [] - process_disabled_reftypes(app.env) + _process_disabled_reftypes(app.env) case(term=True, doc=True, py=True) # disabled a single ref type app.config.intersphinx_disabled_reftypes = ['std:doc'] - process_disabled_reftypes(app.env) + _process_disabled_reftypes(app.env) case(term=True, doc=False, py=True) # disabled a whole domain app.config.intersphinx_disabled_reftypes = ['std:*'] - process_disabled_reftypes(app.env) + _process_disabled_reftypes(app.env) case(term=False, doc=False, py=True) # disabled all domains app.config.intersphinx_disabled_reftypes = ['*'] - process_disabled_reftypes(app.env) + _process_disabled_reftypes(app.env) case(term=False, doc=False, py=False)