summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2021-04-06 15:56:57 (GMT)
committerGitHub <noreply@github.com>2021-04-06 15:56:57 (GMT)
commit57c6cb5100d19a0e0218c77d887c3c239c9ce435 (patch)
tree8e193c0bc12f476821639c8363d280ef9d604271 /Lib/importlib/_bootstrap.py
parentefccff9ac84009ef48e8cb22548ce80940f76533 (diff)
downloadcpython-57c6cb5100d19a0e0218c77d887c3c239c9ce435.zip
cpython-57c6cb5100d19a0e0218c77d887c3c239c9ce435.tar.gz
cpython-57c6cb5100d19a0e0218c77d887c3c239c9ce435.tar.bz2
bpo-42135: Deprecate implementations of find_module() and find_loader() (GH-25169)
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r--Lib/importlib/_bootstrap.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index ab52e77..527bc9c 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -761,6 +761,9 @@ class BuiltinImporter:
This method is deprecated. Use find_spec() instead.
"""
+ _warnings.warn("BuiltinImporter.find_module() is deprecated and "
+ "slated for removal in Python 3.12; use find_spec() instead",
+ DeprecationWarning)
spec = cls.find_spec(fullname, path)
return spec.loader if spec is not None else None
@@ -834,6 +837,9 @@ class FrozenImporter:
This method is deprecated. Use find_spec() instead.
"""
+ _warnings.warn("FrozenImporter.find_module() is deprecated and "
+ "slated for removal in Python 3.12; use find_spec() instead",
+ DeprecationWarning)
return cls if _imp.is_frozen(fullname) else None
@staticmethod