bpo-29576: add explicit deprecation for importlib.abc.find_loader() and find_module() (GH-32)

This commit is contained in:
Matthias Bussonnier 2017-02-15 18:00:32 -08:00 committed by Brett Cannon
parent 72dccde884
commit 1d4601c2c6
5 changed files with 41 additions and 7 deletions

View file

@ -79,7 +79,8 @@ def find_loader(name, path=None):
This function is deprecated in favor of importlib.util.find_spec().
"""
warnings.warn('Use importlib.util.find_spec() instead.',
warnings.warn('Deprecated since Python 3.4. '
'Use importlib.util.find_spec() instead.',
DeprecationWarning, stacklevel=2)
try:
loader = sys.modules[name].__loader__