Commit Graph

114 Commits

Author SHA1 Message Date
Benjamin Peterson
7701e6ef93 make some freezing related stuff const 2013-03-13 14:06:39 -05:00
Brett Cannon
4802becb16 Issue #17117: Have both import itself and importlib.util.set_loader()
set __loader__ on a module when set to None.

Thanks to Gökcen Eraslan for the fix.
2013-03-13 10:41:36 -07:00
Brett Cannon
c190389834 Issue #17220: two fixes for changeset 2528e4aea338.
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.
2013-02-25 17:10:11 -05:00
Serhiy Storchaka
39e47f94ec Issue #17220: Little cleanup of _bootstrap.py. 2013-02-25 15:40:33 +02:00
Ezio Melotti
92bd4ef640 Merge importlib.h rebuild from 3.3 after the changes introduced in 65eaac000147. 2013-02-20 22:15:47 +02:00
Ezio Melotti
795c10b3b6 Rebuild importlib.h after the changes introduced in 0f65bf6063ca. 2013-02-20 21:42:46 +02:00
Benjamin Peterson
419d9a83d5 evaluate lambda keyword-only defaults after positional defaults (#16967 again) 2013-02-10 09:48:22 -05:00
Benjamin Peterson
1ef876cd28 evaluate positional defaults before keyword-only defaults (closes #16967) 2013-02-10 09:29:59 -05:00
Brett Cannon
85ae3566d1 Merge w/ 3.3 more fixes thanks to issue #17098 2013-02-01 16:36:29 -05:00
Brett Cannon
da9cf0eef8 Issue #17098: Be more stringent of setting __loader__ on early imported
modules. Also made test more rigorous.
2013-02-01 15:31:49 -05:00
Brett Cannon
0ecd30b4af Issue #17098: Make sure every module has __loader__ defined.
Thanks to Thomas Heller for the bug report.
2013-02-01 14:04:12 -05:00
Brett Cannon
f3220d6af7 Tweak an exception message 2013-01-27 13:04:56 -05:00
Brett Cannon
14581d5dc4 Port py_compile over to importlib 2013-01-26 08:48:36 -05:00
Brett Cannon
686e880f20 Touch up exception messaging 2013-01-25 13:49:19 -05:00
Brett Cannon
569ff4fbbc Issue #15031: Refactor some code in importlib pertaining to validating
and compiling bytecode.

Thanks to Ronan Lamy for pointing the redundancy and taking an initial
stab at the refactor (as did Nick Coghlan).
2013-01-11 18:09:25 -05:00
Brett Cannon
c57f9f9419 Merge from 3.3 for fix for issue #16730 2013-01-11 15:42:30 -05:00
Brett Cannon
a9976b3e32 Issue #16730: Don't raise an exception in
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.
2013-01-11 15:40:12 -05:00
Andrew Svetlov
f7a17b48d7 Replace IOError with OSError (#16715) 2012-12-25 16:47:37 +02:00
Benjamin Peterson
fc8f5c5e0f update importlib.h 2012-12-19 15:16:51 -06:00
Andrew Svetlov
ad28c7f9da Issue #16706: get rid of os.error 2012-12-18 22:02:39 +02:00
Eric Snow
a6cfb28bd2 Issue #15627: This is simply an update to the name of a new method recently added
to importlib.abc.SourceLoader.
2012-12-04 23:43:43 -08:00
Barry Warsaw
b72c10996e - Issue #16514: Fix regression causing a traceback when sys.path[0] is None
(actually, any non-string or non-bytes type).
2012-11-20 15:35:27 -05:00
Barry Warsaw
82c1c781c7 - Issue #16514: Fix regression causing a traceback when sys.path[0] is None
(actually, any non-string or non-bytes type).
2012-11-20 15:22:51 -05:00
Brett Cannon
540187f719 Regen importlib.h 2012-11-18 10:27:12 -05:00
Brett Cannon
5650e4f41c Issue #15627: Add the compile_source() method to
importlib.abc.SourceLoader.

This provides an easy hook into the import system to allow for source
transformations, AST optimizations, etc.
2012-11-18 10:03:31 -05:00