Skip to content

Update _frozen_importlib_external for Python 3.15#16036

Open
raul-sq wants to merge 2 commits into
python:mainfrom
raul-sq:fix-frozen-importlib-external-py315
Open

Update _frozen_importlib_external for Python 3.15#16036
raul-sq wants to merge 2 commits into
python:mainfrom
raul-sq:fix-frozen-importlib-external-py315

Conversation

@raul-sq

@raul-sq raul-sq commented Jul 19, 2026

Copy link
Copy Markdown

Syncs _frozen_importlib_external with Python 3.15 changes and removes the
eight corresponding TODO entries from
stdlib/@tests/stubtest_allowlists/py315.txt:

  • load_module() removed on _LoaderBasics and NamespaceLoader
    (deprecated since 3.4 and 3.10 respectively): declarations gated with
    sys.version_info < (3, 15) plus @deprecated, following the existing
    find_module pattern in these stubs.
  • cache_from_source(): the debug_override parameter (deprecated since
    3.5) was removed in 3.15; the function is now version-branched, keeping the
    previous overloads unchanged for <= 3.14.
  • SourceLoader.source_to_code() / SourceFileLoader.source_to_code():
    Python 3.15 adds a fullname parameter; signatures are version-branched.
  • PathFinder.discover() / FileFinder.discover(): new methods in 3.15
    (classmethod and instance method respectively), added under
    sys.version_info >= (3, 15).
  • NamespacePath: _NamespacePath was made public in 3.15 (the private
    name is kept as an alias); the class is added under
    sys.version_info >= (3, 15).

The discover() and NamespacePath signatures were derived from
Lib/importlib/_bootstrap_external.py on the CPython 3.15 branch and may
benefit from extra reviewer scrutiny.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant