diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-07-20 04:23:48 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-07-20 04:23:48 (GMT) |
commit | 6919427e9462d05f402faa5f846f43e08347cebe (patch) | |
tree | 862ce874c7e299b7eb5078a7a5b668e4b17b9918 /Lib/importlib/test/test_abc.py | |
parent | 64ef00fa605463e1da84e43ea8a5d722843174b6 (diff) | |
download | cpython-6919427e9462d05f402faa5f846f43e08347cebe.zip cpython-6919427e9462d05f402faa5f846f43e08347cebe.tar.gz cpython-6919427e9462d05f402faa5f846f43e08347cebe.tar.bz2 |
Implement the PEP 302 protocol for get_filename() as
importlib.abc.ExecutionLoader. PyLoader now inherits from this ABC instead of
InspectLoader directly. Both PyLoader and PyPycLoader provide concrete
implementations of get_filename in terms of source_path and bytecode_path.
Diffstat (limited to 'Lib/importlib/test/test_abc.py')
-rw-r--r-- | Lib/importlib/test/test_abc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/importlib/test/test_abc.py b/Lib/importlib/test/test_abc.py index 6e09534..5229ba4 100644 --- a/Lib/importlib/test/test_abc.py +++ b/Lib/importlib/test/test_abc.py @@ -53,9 +53,15 @@ class InspectLoader(InheritanceTests, unittest.TestCase): machinery.FrozenImporter] +class ExecutionLoader(InheritanceTests, unittest.TestCase): + + superclasses = [abc.InspectLoader] + subclasses = [abc.PyLoader] + + class PyLoader(InheritanceTests, unittest.TestCase): - superclasses = [abc.Loader, abc.ResourceLoader, abc.InspectLoader] + superclasses = [abc.Loader, abc.ResourceLoader, abc.ExecutionLoader] class PyPycLoader(InheritanceTests, unittest.TestCase): |