diff options
author | Brett Cannon <brett@python.org> | 2021-03-26 11:55:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-26 11:55:07 -0700 |
commit | 1899087b21119c5c64cd41619b542c0bf0ab5751 (patch) | |
tree | 400c834041ef28eacaac8fa0169e2482dea8a775 /Lib/importlib/_abc.py | |
parent | 21a2cabb3795f5170c746ab8f29e9d25c7442550 (diff) | |
download | cpython-1899087b21119c5c64cd41619b542c0bf0ab5751.tar.gz cpython-1899087b21119c5c64cd41619b542c0bf0ab5751.zip |
bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)
Diffstat (limited to 'Lib/importlib/_abc.py')
-rw-r--r-- | Lib/importlib/_abc.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/importlib/_abc.py b/Lib/importlib/_abc.py index 7591946a4e7..f80348fc7ff 100644 --- a/Lib/importlib/_abc.py +++ b/Lib/importlib/_abc.py @@ -1,6 +1,7 @@ """Subset of importlib.abc used to reduce importlib.util imports.""" from . import _bootstrap import abc +import warnings class Loader(metaclass=abc.ABCMeta): @@ -47,5 +48,7 @@ class Loader(metaclass=abc.ABCMeta): This method is deprecated. """ + warnings.warn("importlib.abc.Loader.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) # The exception will cause ModuleType.__repr__ to ignore this method. raise NotImplementedError |