Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | Issues #18088, 18089: Introduce | Brett Cannon | 2013-05-31 | 1 | -3519/+3511 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. | |||||
* | | Rename importlib.util.ModuleManager to module_to_load so that the name | Brett Cannon | 2013-05-30 | 1 | -3509/+3522 | |
| | | | | | | | | explains better what the context manager is providing. | |||||
* | | Issue #18070: importlib.util.module_for_loader() now sets __loader__ | Brett Cannon | 2013-05-28 | 1 | -3432/+3413 | |
| | | | | | | | | | | and __package__ unconditionally in order to do the right thing for reloading. | |||||
* | | Update importlib.h | Brett Cannon | 2013-05-28 | 1 | -2676/+2675 | |
| | | ||||||
* | | Introduce importlib.util.ModuleManager which is a context manager to | Brett Cannon | 2013-05-28 | 1 | -3328/+3400 | |
| | | | | | | | | | | | | | | | | 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. | |||||
* | | rather than passing locals to the class body, just execute the class body in ↵ | Benjamin Peterson | 2013-05-16 | 1 | -3131/+3121 | |
| | | | | | | | | the proper environment | |||||
* | | hide the __class__ closure from the class body (#12370) | Benjamin Peterson | 2013-05-15 | 1 | -119/+119 | |
| | | ||||||
* | | #17115,17116: Have modules initialize the __package__ and __loader__ | Brett Cannon | 2013-05-04 | 1 | -181/+182 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes to None. The long-term goal is for people to be able to rely on these attributes existing and checking for None to see if they have been set. Since import itself sets these attributes when a loader does not the only instances when the attributes are None are from someone overloading __import__() and not using a loader or someone creating a module from scratch. This patch also unifies module initialization. Before you could have different attributes with default values depending on how the module object was created. Now the only way to not get the same default set of attributes is to circumvent initialization by calling ModuleType.__new__() directly. | |||||
* | | check local class namespace before reaching for cells (closes #17853) | Benjamin Peterson | 2013-04-30 | 1 | -119/+119 | |
| | | ||||||
* | | Issue #17244: Don't mask exceptions raised during the creation of | Brett Cannon | 2013-04-14 | 1 | -3467/+3479 | |
| | | | | | | | | | | | | bytecode files in py_compile. Thanks to Arfrever Frehtes Taifersar Arahesis for the bug report. | |||||
* | | Issue #17093,17566,17567: Methods from classes in importlib.abc now raise/return | Brett Cannon | 2013-04-09 | 1 | -1769/+1776 | |
| | | | | | | | | | | | | | | | | | | | | the default exception/value when called instead of raising/returning NotimplementedError/NotImplemented (except where appropriate). This should allow for the ABCs to act as the bottom/end of the MRO with expected default results. As part of this work, also make importlib.abc.Loader.module_repr() optional instead of an abstractmethod. | |||||
* | | merge | Brett Cannon | 2013-04-01 | 1 | -3448/+3457 | |
|\ \ | |/ | ||||||
| * | Issue #17357: Add missing verbosity messages when running under | Brett Cannon | 2013-04-01 | 1 | -4268/+4281 | |
| | | | | | | | | -v/-vv that were lost in the transition to importlib. | |||||
* | | update importlib.h | Benjamin Peterson | 2013-03-27 | 1 | -117/+117 | |
| | | ||||||
* | | copy 2.7 magic numbers for historical interest | Benjamin Peterson | 2013-03-22 | 1 | -4092/+3158 | |
| | | ||||||
* | | make some freezing related stuff const | Benjamin Peterson | 2013-03-13 | 1 | -1/+1 | |
| | | ||||||
* | | Issue #17117: Have both import itself and importlib.util.set_loader() | Brett Cannon | 2013-03-13 | 1 | -3325/+3320 | |
| | | | | | | | | | | | | set __loader__ on a module when set to None. Thanks to Gökcen Eraslan for the fix. | |||||
* | | Issue #17220: two fixes for changeset 2528e4aea338. | Brett Cannon | 2013-02-25 | 1 | -4190/+4192 | |
| | | | | | | | | | | | | | | | | | | First, because the mtime can exceed 4 bytes, make sure to mask it down to 4 bytes before getting its little-endian representation for writing out to a .pyc file. Two, cap an rsplit() call to 1 split, else can lead to too many values being returned for unpacking. | |||||
* | | Issue #17220: Little cleanup of _bootstrap.py. | Serhiy Storchaka | 2013-02-25 | 1 | -4314/+4296 | |
| | | ||||||
* | | Merge importlib.h rebuild from 3.3 after the changes introduced in 65eaac000147. | Ezio Melotti | 2013-02-20 | 1 | -1087/+1084 | |
|\ \ | |/ | ||||||
| * | Rebuild importlib.h after the changes introduced in 0f65bf6063ca. | Ezio Melotti | 2013-02-20 | 1 | -1092/+1089 | |
| | | ||||||
* | | evaluate lambda keyword-only defaults after positional defaults (#16967 again) | Benjamin Peterson | 2013-02-10 | 1 | -1/+1 | |
| | | ||||||
* | | evaluate positional defaults before keyword-only defaults (closes #16967) | Benjamin Peterson | 2013-02-10 | 1 | -119/+119 | |
| | | ||||||
* | | Merge w/ 3.3 more fixes thanks to issue #17098 | Brett Cannon | 2013-02-01 | 1 | -269/+282 | |
|\ \ | |/ | ||||||
| * | Issue #17098: Be more stringent of setting __loader__ on early imported | Brett Cannon | 2013-02-01 | 1 | -292/+299 | |
| | | | | | | | | modules. Also made test more rigorous. | |||||
| * | Issue #17098: Make sure every module has __loader__ defined. | Brett Cannon | 2013-02-01 | 1 | -283/+289 | |
| | | | | | | | | Thanks to Thomas Heller for the bug report. | |||||
* | | Tweak an exception message | Brett Cannon | 2013-01-27 | 1 | -2943/+2943 | |
| | | ||||||
* | | Port py_compile over to importlib | Brett Cannon | 2013-01-26 | 1 | -4269/+4295 | |
| | | ||||||
* | | Touch up exception messaging | Brett Cannon | 2013-01-25 | 1 | -2921/+2923 | |
| | | ||||||
* | | Issue #15031: Refactor some code in importlib pertaining to validating | Brett Cannon | 2013-01-11 | 1 | -4226/+4262 | |
| | | | | | | | | | | | | | | and compiling bytecode. Thanks to Ronan Lamy for pointing the redundancy and taking an initial stab at the refactor (as did Nick Coghlan). | |||||
* | | Merge from 3.3 for fix for issue #16730 | Brett Cannon | 2013-01-11 | 1 | -938/+941 | |
|\ \ | |/ | ||||||
| * | Issue #16730: Don't raise an exception in | Brett Cannon | 2013-01-11 | 1 | -943/+946 | |
| | | | | | | | | | | | | | | | | importlib.machinery.FileFinder when the directory has become unreadable or a file. This brings semantics in line with Python 3.2 import. Reported and diagnosed by David Pritchard. | |||||
* | | Replace IOError with OSError (#16715) | Andrew Svetlov | 2012-12-25 | 1 | -2/+2 | |
| | | ||||||
* | | update importlib.h | Benjamin Peterson | 2012-12-19 | 1 | -2633/+2632 | |
| | | ||||||
* | | Issue #16706: get rid of os.error | Andrew Svetlov | 2012-12-18 | 1 | -4034/+3999 | |
| | | ||||||
* | | Issue #15627: This is simply an update to the name of a new method recently ↵ | Eric Snow | 2012-12-05 | 1 | -8/+8 | |
| | | | | | | | | | | | | added to importlib.abc.SourceLoader. | |||||
* | | - Issue #16514: Fix regression causing a traceback when sys.path[0] is None | Barry Warsaw | 2012-11-20 | 1 | -63/+67 | |
|\ \ | |/ | | | | | (actually, any non-string or non-bytes type). | |||||
| * | - Issue #16514: Fix regression causing a traceback when sys.path[0] is None | Barry Warsaw | 2012-11-20 | 1 | -63/+67 | |
| | | | | | | | | (actually, any non-string or non-bytes type). | |||||
* | | Regen importlib.h | Brett Cannon | 2012-11-18 | 1 | -2170/+2173 | |
| | | ||||||
* | | Issue #15627: Add the compile_source() method to | Brett Cannon | 2012-11-18 | 1 | -2327/+2347 | |
| | | | | | | | | | | | | | | importlib.abc.SourceLoader. This provides an easy hook into the import system to allow for source transformations, AST optimizations, etc. | |||||
* | | merge 3.3 (sort of) | Benjamin Peterson | 2012-11-12 | 1 | -1532/+1532 | |
|\ \ | |/ | ||||||
| * | recompile importlib.h | Benjamin Peterson | 2012-11-12 | 1 | -1543/+1543 | |
| | | ||||||
* | | Merge fix from #6074 from 3.3 | Nick Coghlan | 2012-10-19 | 1 | -1876/+1877 | |
|\ \ | |/ | ||||||
| * | Issue #6074: Apply an appropriate fix for importlib based imports | Nick Coghlan | 2012-10-19 | 1 | -1884/+1885 | |
| | | ||||||
* | | Merge issue #15833: don't raise an exception if importlib can't write | Trent Nelson | 2012-10-16 | 1 | -1833/+1840 | |
|\ \ | |/ | | | | | | | | | | | | | byte-compiled files. This fixes a regression introduced by 3.3. Patch by Charles-François Natali. | |||||
| * | Issue #15833: don't raise an exception if importlib can't write byte-compiled | Trent Nelson | 2012-10-16 | 1 | -1839/+1845 | |
| | | | | | | | | | | | | files. This fixes a regression introduced by 3.3. Patch by Charles-François Natali. | |||||
* | | Remove uses of % with str.format. | Brett Cannon | 2012-10-12 | 1 | -3746/+3748 | |
| | | ||||||
* | | Merge fix for issue #15111. | Brett Cannon | 2012-10-10 | 1 | -460/+464 | |
|\ \ | |/ | ||||||
| * | Closes issue #15111: Calling __import__ with a module specified in | Brett Cannon | 2012-10-10 | 1 | -467/+471 | |
| | | | | | | | | | | fromlist which causes its own ImportError (e.g. the module tries to import a non-existent module) should have that exception propagate. | |||||
* | | Closes #16135: Removal of OS/2 support | Jesus Cea | 2012-10-05 | 1 | -108/+102 | |
|/ |