summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2013-10-03 18:08:55 (GMT)
committerEric Snow <ericsnowcurrently@gmail.com>2013-10-03 18:08:55 (GMT)
commitaf8566c84783a9c5cea852a2e4e2e729be7cf5a8 (patch)
tree7b37fb960be9b95aa1758d24adcc52904b5fdb7f /Lib/importlib
parentefbc4752781463dfb6a61baf6ce8b3c0bf3d5ee9 (diff)
downloadcpython-af8566c84783a9c5cea852a2e4e2e729be7cf5a8.zip
cpython-af8566c84783a9c5cea852a2e4e2e729be7cf5a8.tar.gz
cpython-af8566c84783a9c5cea852a2e4e2e729be7cf5a8.tar.bz2
[issue19152] Add ExtensionFileLoader.get_filename().
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py5
-rw-r--r--Lib/importlib/abc.py2
2 files changed, 7 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index e40ec92..83c51f8 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1153,6 +1153,11 @@ class ExtensionFileLoader:
"""Return None as extension modules have no source code."""
return None
+ @_check_name
+ def get_filename(self, fullname):
+ """Return the path to the source file as found by the finder."""
+ return self.path
+
class _NamespacePath:
"""Represents a namespace package's path. It uses the module name
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 387567a..438a01d 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -168,6 +168,8 @@ class ExecutionLoader(InspectLoader):
set to."""
raise NotImplementedError
+_register(machinery.ExtensionFileLoader)
+
class FileLoader(_bootstrap.FileLoader, ResourceLoader, ExecutionLoader):