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
commit1500d49c22e1a38d186f2dddfa6ba2c5a6cd7d5e (patch)
treeee32b3fd82c294c8bf257949a22481121d8ef246 /Lib/importlib/abc.py
parent02b9f9d6bb596d437ac10d71afac8a4781d18d86 (diff)
downloadcpython-git-1500d49c22e1a38d186f2dddfa6ba2c5a6cd7d5e.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