summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
Commit message (Collapse)AuthorAgeFilesLines
* Importlib was not matching import's handling of .pyc files where it had lessBrett Cannon2010-02-192-29/+109
| | | | | | then 8 bytes total in the file. Fixes issues 7361 & 7875.
* Clarify importlib.abc.PyPycLoader.write_bytecode().Brett Cannon2009-12-121-2/+3
|
* no need to translate newlines in python code anymoreBenjamin Peterson2009-11-131-15/+0
|
* When trying to write new bytecode, importlib was not catching the IOErrorBrett Cannon2009-11-072-2/+28
| | | | | | | thrown if the file happened to be read-only to keep the failure silent. Fixes issue #7187. Thanks, Dave Malcolm for the report and analysis of the problem.
* Use tempfile.mkdtemp() instead of tempfile.tempdir for where importlib placesBrett Cannon2009-11-051-11/+4
| | | | | | | source files for tests. Allows for concurrent execution of the tests by preventing various executions from trampling each other. Closes issue #7248.
* importlib.test.source.util referenced variables in the 'finally' part of aBrett Cannon2009-11-051-2/+6
| | | | try/finally which may not have been set.
* Rework importlib benchmarks so that they measure number of executions within aBrett Cannon2009-09-031-51/+52
| | | | | | | | second instead of some fixed number. Keeps benchmark faster by putting a cap on total execution time. Before a run using importlib took longer by some factor, but now it takes roughly the same amount of time as using the built-in __import__.
* Clarify why test_import is failing under importlib.Brett Cannon2009-08-301-2/+3
|
* Trying to import a submodule from another module and not a package was raisingBrett Cannon2009-08-303-4/+11
| | | | | | AttributeError in importlib when it should be an ImportError. Found when running importlib against test_runpy.
* test_pep3120 is no longer a problem for importlib as the test was tweaked.Brett Cannon2009-08-301-1/+0
|
* When the globals argument to importlib.__import__() contained any value forBrett Cannon2009-08-302-11/+17
| | | | | | | | __package__, it was used. This was incorrect since it could be set to None to represent the fact that a proper value was unknown. Now None will trigger the calculation for __package__. Discovered when running importlib against test_importhooks.
* Turn on verbose2 for importlib.test.regrtest so as to see failures when they ↵Brett Cannon2009-08-301-2/+1
| | | | occur.
* Raise TypeError if the name given to importlib.__import__() lacks an rpartitionBrett Cannon2009-08-303-1/+24
| | | | | | | | attribute. Was throwing AttributeError before. Discovered when running test_builtin against importlib. This exception change is specific to importlib.__import__() and does not apply to import_module() as it is being done for compatibility reasons only.
* Fix the importlib_only test decorator to work again; don't capture the flag ↵Brett Cannon2009-08-301-1/+3
| | | | variable as it might change later.
* Use the public API, not a private one.Brett Cannon2009-08-301-1/+1
|
* Allow importlib.__import__ to accept any iterable for fromlist. Discovered whenBrett Cannon2009-08-302-2/+10
| | | | running importlib against test___all__.
* Provide module docstrings for the two main test drivers in importlib thatBrett Cannon2009-08-302-2/+11
| | | | | explain what they are for and how to use command-line arguments to tweak semantics.
* Tweak importlib.test.regrtest to only specify the implicit tests to excludeBrett Cannon2009-08-301-4/+6
| | | | | when running entire test suite. Allows normal command-line arguments normally given to test.regrtest to work (e.g. specifying a single test).
* Have importlib raise ImportError if None is found in sys.modules. This matchesBrett Cannon2009-08-302-5/+20
| | | | current import semantics.
* Add a test file to importlib that runs regrtest using importlib.__import__.Brett Cannon2009-08-271-0/+33
| | | | | | | | | The file must be run using runpy. Certain tests are currently excluded from being run as they have known failures based on golden value checks that fail for various reasons (typically because __loader__ is not expected to be set on modules). Running the tests with this file does discover some incompatibilites in importlib that will be fixed in the near future (as noted currently in the docstring).
* Add support for a --builtin argument to importlib.test to trigger runningBrett Cannon2009-08-271-0/+5
| | | | import-specific tests with __import__ instead of importlib.
* Move over to using assertRaises as a context manager for importlib tests.Brett Cannon2009-08-279-24/+36
| | | | | Obviously one shouldn't do whole sale conversions like this, but I was already going through the test code and I was bored at the airport.
* Make __package__ setting tests specific to importlib. Also move to ↵Brett Cannon2009-08-271-4/+5
| | | | assertRaises context manager.
* Move a test-skipping decorator over to unittest.skipIf.Brett Cannon2009-08-271-10/+3
|
* Implement the PEP 302 protocol for get_filename() asBrett Cannon2009-07-204-22/+95
| | | | | | 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.
* Importlib's documentation said that importlib.abc.PyLoader inherited fromBrett Cannon2009-07-202-15/+62
| | | | | | | | | importlib.abc.ResourceLoader, when in fact it did not. Fixed the ABC to inherit as documented. This doesn't introduce an backwards-incompatiblity as the code in PyLoader already required the single method ResourceLoader defined as an abstract method.
* Remove custom test-skipping code in importlib tests for unittest code.Brett Cannon2009-07-201-13/+14
|
* Some tests in importlib.test.source.test_abc_loader were testing what happensBrett Cannon2009-07-201-8/+16
| | | | | | | | when a loader is given missing or bad code object bytecode. Unfortunately an exception related to source paths was masking what the proper exception to test should be. Making the test explicitly set the environment fixed the test. The code being test was not affected.
* Update importlib.test.source.test_abc_loader to new features added in Python ↵Brett Cannon2009-07-191-17/+19
| | | | 3.1.
* Importlib was using custom code to discover all test modules in importlib.test.Brett Cannon2009-07-152-31/+14
| | | | | This has now been removed in favor of using unittest's test discovery code in TestLoader.discover().
* Remove unused import for function that no longer exists.R. David Murray2009-07-011-1/+0
|
* convert old fail* assertions to assert*Benjamin Peterson2009-06-3019-85/+85
|
* Fixup/simplify another nested context manager.Raymond Hettinger2009-06-121-6/+3
|
* Tests for case-senstivity were not being skipped for darwin when installed on aBrett Cannon2009-05-116-45/+37
| | | | | | | case-sensitive filesystems -- which is not the default case. Along the way also fixed the skipping of tests when sys.dont_write_bytecode is true. Closes issue #5442 again.
* fix name againBenjamin Peterson2009-04-041-1/+1
|
* fix nameBenjamin Peterson2009-04-041-1/+1
|
* fix namingBenjamin Peterson2009-04-031-3/+3
|
* os.path.listdir -> os.listdirBenjamin Peterson2009-04-031-1/+1
|
* importlib.test.source.test_abc_loader was making a bad assumption that all fileBrett Cannon2009-04-021-16/+21
| | | | | | paths used '/' as a path separator. Fixes issue #5646.
* Make a test in importlib have a more robust test value.Brett Cannon2009-04-021-1/+1
|
* Give a more informative message on an importlib test upon failure.Brett Cannon2009-04-021-1/+3
|
* Check that on a platform that is expected to have a case-insensitive filesystemBrett Cannon2009-04-021-1/+8
| | | | | | that is in fact the case. Closes issue #5442.
* Rip out a useless method that the superclass implements properly.Brett Cannon2009-04-011-19/+0
|
* Fix importlib.machinery.PathFinder.find_module() to essentially skip over NoneBrett Cannon2009-03-302-3/+23
| | | | | | entries in sys.path_importer_cache. While this differs from semantics in how __import__ works, it prevents any implicit semantics from taking hold with users.
* Add simple tests for __import__ for future optimizations to importlib.Brett Cannon2009-03-301-0/+82
|
* Document import's semantics for the language reference. This includes fillingBrett Cannon2009-03-211-7/+0
| | | | in missing details for the sys module.
* Implement InspectLoader for FrozenImporter.Brett Cannon2009-03-154-9/+65
|
* Implement InspectLoader for BuiltinImporter.Brett Cannon2009-03-156-22/+80
|
* A few more docstring/API cleanups for importlib.Brett Cannon2009-03-154-53/+55
|
* Clean up docstring from importlib.util.module_for_loader.Brett Cannon2009-03-151-8/+8
|