summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/test_util.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue 19944: Fix importlib.find_spec() so it imports parents as needed.Eric Snow2014-01-251-0/+147
| | | | The function is also moved to importlib.util.
* Issue 19713: Add PEP 451-related deprecations.Eric Snow2014-01-071-8/+18
|
* Implement PEP 451 (ModuleSpec).Eric Snow2013-11-221-65/+0
|
* Issue #16803: Move test_importlib.test_util to use both frozen andBrett Cannon2013-10-181-50/+85
| | | | source code.
* Issue #18076: Introduce imoportlib.util.decode_source().Brett Cannon2013-06-161-0/+21
| | | | | | | The helper function makes it easier to implement imoprtlib.abc.InspectLoader.get_source() by making that function require just the raw bytes for source code and handling all other details.
* Issue #17177: stop using imp in test_importlibBrett Cannon2013-06-151-15/+15
|
* Issue #17907: touch up the code for imp.new_module().Brett Cannon2013-06-151-0/+116
|
* Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document theBrett Cannon2013-06-141-0/+11
| | | | deprecation of imp.get_magic().
* Issues #18088, 18089: IntroduceBrett Cannon2013-05-311-5/+19
| | | | | | | | | | | | | | | | | | | | | importlib.abc.Loader.init_module_attrs() and implement importlib.abc.InspectLoader.load_module(). The importlib.abc.Loader.init_module_attrs() method sets the various attributes on the module being loaded. It is done unconditionally to support reloading. Typically people used importlib.util.module_for_loader, but since that's a decorator there was no way to override it's actions, so init_module_attrs() came into existence to allow for overriding. This is also why module_for_loader is now pending deprecation (having its other use replaced by importlib.util.module_to_load). All of this allowed for importlib.abc.InspectLoader.load_module() to be implemented. At this point you can now implement a loader with nothing more than get_code() (which only requires get_source(); package support requires is_package()). Thanks to init_module_attrs() the implementation of load_module() is basically a context manager containing 2 methods calls, a call to exec(), and a return statement.
* Add a reset_name argument to importlib.util.module_to_load in order toBrett Cannon2013-05-311-0/+12
| | | | | control whether to reset the module's __name__ attribute in case a reload is being done.
* Rename importlib.util.ModuleManager to module_to_load so that the nameBrett Cannon2013-05-301-7/+7
| | | | explains better what the context manager is providing.
* Issue #18070: importlib.util.module_for_loader() now sets __loader__Brett Cannon2013-05-281-1/+12
| | | | | and __package__ unconditionally in order to do the right thing for reloading.
* Introduce importlib.util.ModuleManager which is a context manager toBrett Cannon2013-05-281-0/+50
| | | | | | | | handle providing (and cleaning up if needed) the module to be loaded. A future commit will use the context manager in Lib/importlib/_bootstrap.py and thus why the code is placed there instead of in Lib/importlib/util.py.
* Issue #17117: Have both import itself and importlib.util.set_loader()Brett Cannon2013-03-131-10/+32
| | | | | | set __loader__ on a module when set to None. Thanks to Gökcen Eraslan for the fix.
* Issue #15168: Move importlb.test to test.test_importlib.Brett Cannon2012-07-201-0/+208
This should make the Linux distros happy as it is now easier to leave importlib's tests out of their base Python distribution.