summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2021-04-03 22:31:15 (GMT)
committerGitHub <noreply@github.com>2021-04-03 22:31:15 (GMT)
commitdc6d3e1e4c0c1e4b2210edab8fb4762569dc2936 (patch)
tree80ae8d9059b68a4803a02c7269dba190f7596678 /Lib/importlib
parentc5354c045c1067549554c35485a12afdcf88a202 (diff)
downloadcpython-dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936.zip
cpython-dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936.tar.gz
cpython-dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936.tar.bz2
bpo-43720: Update import-related stdlib deprecation messages to say they will be removed in Python 3.12 (GH-25167)
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/util.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py
index 98a0fa5..8623c89 100644
--- a/Lib/importlib/util.py
+++ b/Lib/importlib/util.py
@@ -149,7 +149,8 @@ def set_package(fxn):
"""
@functools.wraps(fxn)
def set_package_wrapper(*args, **kwargs):
- warnings.warn('The import system now takes care of this automatically.',
+ warnings.warn('The import system now takes care of this automatically; '
+ 'this decorator is slated for removal in Python 3.12',
DeprecationWarning, stacklevel=2)
module = fxn(*args, **kwargs)
if getattr(module, '__package__', None) is None:
@@ -168,7 +169,8 @@ def set_loader(fxn):
"""
@functools.wraps(fxn)
def set_loader_wrapper(self, *args, **kwargs):
- warnings.warn('The import system now takes care of this automatically.',
+ warnings.warn('The import system now takes care of this automatically; '
+ 'this decorator is slated for removal in Python 3.12',
DeprecationWarning, stacklevel=2)
module = fxn(self, *args, **kwargs)
if getattr(module, '__loader__', None) is None:
@@ -195,7 +197,8 @@ def module_for_loader(fxn):
the second argument.
"""
- warnings.warn('The import system now takes care of this automatically.',
+ warnings.warn('The import system now takes care of this automatically; '
+ 'this decorator is slated for removal in Python 3.12',
DeprecationWarning, stacklevel=2)
@functools.wraps(fxn)
def module_for_loader_wrapper(self, fullname, *args, **kwargs):