Commit Graph

37 Commits

Author SHA1 Message Date
Brett Cannon
435aad878c Rename importlib.util.set___package__ to set_package. 2009-03-04 16:07:00 +00:00
Brett Cannon
b5f03c6779 Add a test for importlib.import_module. 2009-03-04 01:02:54 +00:00
Brett Cannon
57b46f5b0e Expose importlib.util.set___package__. 2009-03-02 14:38:26 +00:00
Brett Cannon
91cf882b36 Refactor source and bytecode file loaders in importlib so that there
are source-only and source/bytecode loaders.
2009-02-21 05:41:15 +00:00
Brett Cannon
4afab6b30b Separate out finder for source and source/bytecode. 2009-02-21 03:31:35 +00:00
Brett Cannon
2dee597e05 Do some cleanup in importlib:
+ Ditch using arguments to super().
+ Ditch subclassing from object directly.
+ Move directory check out of chaining path hook to file path hook/finder.
+ Rename some classes to better reflect they are finders, not importers.
2009-02-21 03:15:37 +00:00
Brett Cannon
d2e7b33815 Implement the more specific PEP 302 semantics for loaders and what happens upon
load failure in relation to reloads. Also expose
importlib.util.module_for_loader to handle all of the details of this along
with making sure all current loaders behave nicely.
2009-02-17 02:45:03 +00:00
Brett Cannon
32732e3fbd Change importlib.machinery.PathFinder to not have implicit semantics (that's
not handled by importlib._bootstrap._DefaultPathFinder).
2009-02-15 05:48:13 +00:00
Brett Cannon
7bf8d4ed4d Add the missing importlib.test.extension.util. 2009-02-07 02:33:52 +00:00
Brett Cannon
534b2cd176 Factor out helper code from importlib.test.extension.test_path_hook. 2009-02-07 02:06:43 +00:00
Brett Cannon
06c9d96b70 Move importlib completely over to using rpartition and accepting the empty
string for top-level modules.
2009-02-07 01:52:25 +00:00
Brett Cannon
d94e558fdc Move importlib's built-in importer to use rpartition for __package__. 2009-02-07 01:40:19 +00:00
Brett Cannon
eb2e0dd19d Move importlib's frozen importer over to rpartition for setting __package__. 2009-02-07 01:38:38 +00:00
Brett Cannon
2c318a1390 Rewrite the code implementing __import__ for importlib. Now it is much simpler
and relies much more on meta path finders to abstract out various parts of
import.

As part of this the semantics for import_module tightened up and now follow
__import__ much more closely (biggest thing is that the 'package' argument must
now already be imported, else a SystemError is raised).
2009-02-07 01:15:27 +00:00
Brett Cannon
6411aa5dd4 Finish implementing tests for importlib.machinery.PathFinder by testing that
implicit hooks are handled properly.
2009-02-06 00:07:49 +00:00
Brett Cannon
1f9bcd38a9 Add tests for using sys.path_hooks by importlib.machinery.PathFinder. 2009-02-05 23:36:02 +00:00
Brett Cannon
48f5c4eec6 Implement test for sys.path_importer_cache having None for
importlib.machinery.PathFinder.
2009-02-05 22:02:03 +00:00
Brett Cannon
939ea76b3c Begin writing tests for importlib.machinery.PathFinder. 2009-02-05 02:53:23 +00:00
Brett Cannon
d720b36248 Move import semantic util code to importlib.test.import_.util. 2009-02-01 04:28:04 +00:00
Brett Cannon
bcb26c53c0 Rename importlib.test.support to importlib.test.util. 2009-02-01 04:00:05 +00:00
Brett Cannon
ae9ad186d0 Do not execute the .pyc/.pyo files as well as the .py files. 2009-02-01 03:51:54 +00:00
Brett Cannon
4ee2cdaf65 Split out support code that is specific to source tests out of
importlib.test.support to importlib.test.source.util.
2009-02-01 03:08:31 +00:00
Brett Cannon
30b047dc35 Move source loader tests (including reload tests) over to
importlib.test.abc.LoaderTests.
2009-02-01 02:05:11 +00:00
Brett Cannon
223a19d8b1 Fix importlib.machinery.FrozenImporter.load_module() to set __package__
properly. Discovered by also moving the loader tests over to
importlib.test.abc.LoaderTests.
2009-02-01 01:34:13 +00:00
Brett Cannon
e70485e7c1 Move extension module loader tests over to importlib.test.abc.LoaderTests. 2009-02-01 00:49:41 +00:00