diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-01-22 22:43:07 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-01-22 22:43:07 (GMT) |
commit | 5abdc93eb85bc434c3b81b6c7fd1f05e7c9b5fb8 (patch) | |
tree | 17dbd10a78d4efc28ab798d9cdb3146419223c28 /Lib/importlib/test | |
parent | 7b3c89d88cac53325b30f583643d288426d90789 (diff) | |
download | cpython-5abdc93eb85bc434c3b81b6c7fd1f05e7c9b5fb8.zip cpython-5abdc93eb85bc434c3b81b6c7fd1f05e7c9b5fb8.tar.gz cpython-5abdc93eb85bc434c3b81b6c7fd1f05e7c9b5fb8.tar.bz2 |
Add importlib.machinery with its first tenants, BuitinImporter and
FrozenImporter. Docs forthcoming.
I plan on all finders and loaders (and most likely hooks) to live
in imoprtlib.machinery. Utility stuff will end up in importlib.util.
Higher-level API stuff will stay on imoprtlib directly (e.g. import_module).
Diffstat (limited to 'Lib/importlib/test')
-rw-r--r-- | Lib/importlib/test/builtin/test_finder.py | 4 | ||||
-rw-r--r-- | Lib/importlib/test/builtin/test_loader.py | 3 | ||||
-rw-r--r-- | Lib/importlib/test/frozen/test_finder.py | 4 | ||||
-rw-r--r-- | Lib/importlib/test/frozen/test_loader.py | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/Lib/importlib/test/builtin/test_finder.py b/Lib/importlib/test/builtin/test_finder.py index 5262aaa..7d7ff36 100644 --- a/Lib/importlib/test/builtin/test_finder.py +++ b/Lib/importlib/test/builtin/test_finder.py @@ -1,4 +1,4 @@ -import importlib +from importlib import machinery from .. import support import sys @@ -12,7 +12,7 @@ class FinderTests(unittest.TestCase): name = 'errno' find_module = staticmethod(lambda name, path=None: - importlib.BuiltinImporter().find_module(name, path)) + machinery.BuiltinImporter.find_module(name, path)) def test_find_module(self): diff --git a/Lib/importlib/test/builtin/test_loader.py b/Lib/importlib/test/builtin/test_loader.py index 5aa3d79..87726c9 100644 --- a/Lib/importlib/test/builtin/test_loader.py +++ b/Lib/importlib/test/builtin/test_loader.py @@ -1,4 +1,5 @@ import importlib +from importlib import machinery from .. import support import sys @@ -23,7 +24,7 @@ class LoaderTests(unittest.TestCase): self.assert_(module.__name__ in sys.modules) load_module = staticmethod(lambda name: - importlib.BuiltinImporter().load_module(name)) + machinery.BuiltinImporter.load_module(name)) def test_load_module(self): # Common case. diff --git a/Lib/importlib/test/frozen/test_finder.py b/Lib/importlib/test/frozen/test_finder.py index 2541019..8d8a8af 100644 --- a/Lib/importlib/test/frozen/test_finder.py +++ b/Lib/importlib/test/frozen/test_finder.py @@ -1,4 +1,4 @@ -import importlib +from importlib import machinery from ..builtin import test_finder from .. import support @@ -10,7 +10,7 @@ class FinderTests(test_finder.FinderTests): """Test finding frozen modules.""" def find(self, name, path=None): - finder = importlib.FrozenImporter() + finder = machinery.FrozenImporter return finder.find_module(name, path) diff --git a/Lib/importlib/test/frozen/test_loader.py b/Lib/importlib/test/frozen/test_loader.py index b37ae7f..95854f2 100644 --- a/Lib/importlib/test/frozen/test_loader.py +++ b/Lib/importlib/test/frozen/test_loader.py @@ -1,4 +1,4 @@ -import importlib +from importlib import machinery from ..builtin import test_loader @@ -6,7 +6,7 @@ class LoaderTests(test_loader.LoaderTests): name = '__phello__' load_module = staticmethod(lambda name: - importlib.FrozenImporter().load_module(name)) + machinery.FrozenImporter.load_module(name)) verification = {'__name__': '__phello__', '__file__': '<frozen>', '__package__': None, '__path__': ['__phello__']} |