gh-121604: Make sure all deprecated items in importlib raise DeprecationWarning (#128007)

Co-authored-by: rashansmith <smith.rashan@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Tomas R. 2025-01-15 01:48:46 +01:00 committed by GitHub
parent b52de22ac3
commit bd3baa8b1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 96 additions and 5 deletions

View file

@ -716,6 +716,12 @@ class WindowsRegistryFinder:
@classmethod
def find_spec(cls, fullname, path=None, target=None):
_warnings.warn('importlib.machinery.WindowsRegistryFinder is '
'deprecated; use site configuration instead. '
'Future versions of Python may not enable this '
'finder by default.',
DeprecationWarning, stacklevel=2)
filepath = cls._search_registry(fullname)
if filepath is None:
return None