import types
import warnings
-warnings.warn("the imp module is deprecated in favour of importlib; "
+warnings.warn("the imp module is deprecated in favour of importlib and slated "
+ "for removal in Python 3.12; "
"see the module's documentation for alternative uses",
DeprecationWarning, stacklevel=2)
"""
@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:
"""
@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:
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):
def __init__(self, path=None):
global imp
- warnings.warn("This emulation is deprecated, use 'importlib' instead",
+ warnings.warn("This emulation is deprecated and slated for removal "
+ "in Python 3.12; use 'importlib' instead",
DeprecationWarning)
_import_imp()
self.path = path
code = source = None
def __init__(self, fullname, file, filename, etc):
- warnings.warn("This emulation is deprecated, use 'importlib' instead",
+ warnings.warn("This emulation is deprecated and slated for removal in "
+ "Python 3.12; use 'importlib' instead",
DeprecationWarning)
_import_imp()
self.file = file
def check_deprecated(self):
return check_warnings(
- ("This emulation is deprecated, use 'importlib' instead",
+ ("This emulation is deprecated and slated for removal in "
+ "Python 3.12; use 'importlib' instead",
DeprecationWarning))
def test_importer_deprecated(self):