summaryrefslogtreecommitdiff
path: root/Lib/importlib/abc.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2014-01-06 20:49:04 -0700
committerEric Snow <ericsnowcurrently@gmail.com>2014-01-06 20:49:04 -0700
commit644feb9f1879811000921deb9f8e56cf2f5c6360 (patch)
treeb7c1f5dd0ea3cee9352c212bcbe68c4ec9e7861e /Lib/importlib/abc.py
parent370875e689b3fa47dcc69165dc46d80dbe151d80 (diff)
downloadcpython-644feb9f1879811000921deb9f8e56cf2f5c6360.tar.gz
Issue 19713: Add PEP 451-related deprecations.
Diffstat (limited to 'Lib/importlib/abc.py')
-rw-r--r--Lib/importlib/abc.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 3995ff2a68..584a41bb6d 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -43,13 +43,14 @@ class MetaPathFinder(Finder):
# We don't define find_spec() here since that would break
# hasattr checks we do to support backward compatibility.
- # XXX Deprecate
def find_module(self, fullname, path):
"""Return a loader for the module.
If no module is found, return None. The fullname is a str and
the path is a list of strings or None.
+ This method is deprecated in favor of finder.find_spec().
+
"""
return None
@@ -69,7 +70,6 @@ class PathEntryFinder(Finder):
# We don't define find_spec() here since that would break
# hasattr checks we do to support backward compatibility.
- # XXX Deprecate.
def find_loader(self, fullname):
"""Return (loader, namespace portion) for the path entry.
@@ -81,10 +81,11 @@ class PathEntryFinder(Finder):
The portion will be discarded if another path entry finder
locates the module as a normal module or package.
+ This method is deprecated in favor of finder.find_spec().
+
"""
return None, []
- # XXX Deprecate.
find_module = _bootstrap._find_module_shim
def invalidate_caches(self):
@@ -115,7 +116,6 @@ class Loader(metaclass=abc.ABCMeta):
# We don't define exec_module() here since that would break
# hasattr checks we do to support backward compatibility.
- # XXX Deprecate.
def load_module(self, fullname):
"""Return the loaded module.
@@ -124,16 +124,19 @@ class Loader(metaclass=abc.ABCMeta):
ImportError is raised on failure.
+ This method is deprecated in favor of loader.exec_module().
+
"""
raise ImportError
- # XXX Deprecate.
def module_repr(self, module):
"""Return a module's repr.
Used by the module type when the method does not raise
NotImplementedError.
+ This method is deprecated.
+
"""
# The exception will cause ModuleType.__repr__ to ignore this method.
raise NotImplementedError