Brett Cannon
461c813164
Issue #15111 : When a module was imported using a 'from import'
statement (e.g. ``from distutils import msvc9compiler``) that triggers
an ImportError of its own (e.g. the non-existence of winreg), let that
exception propagate instead of raising a generic ImportError for the
module being requested (e.g. msvc9compiler).
14 years ago
Brett Cannon
77b2abd094
Issue #15167 (as part of #13959 ): imp.get_magic() is no implemented in
Lib/imp.py.
14 years ago
Brett Cannon
19a2f5961c
Issue #15056 : imp.cache_from_source() and source_from_cache() raise
NotimplementedError when sys.implementation.cache_tag is None.
Thanks to Pranav Ravichandran for taking an initial stab at the patch.
14 years ago
Amaury Forgeot d'Arc
ae7b8f07c1
Issue #15110 : Also hide importlib frames when importing a builtin module fails.
14 years ago
Antoine Pitrou
bc07a5c913
Issue #15110 : Fix the tracebacks generated by "import xxx" to not show the importlib stack frames.
14 years ago
Antoine Pitrou
bc1a7ddc9b
Check-in compiled importlib changes (you must run "make" after modifying the importlib sources).
14 years ago
Brett Cannon
98979b85e7
Issue #15166 : Re-implement imp.get_tag() using sys.implementation.
Also eliminates some C code in Python/import.c as well.
Patch by Eric Snow with verification by comparing against another
patch from Jeff Knupp.
14 years ago
Antoine Pitrou
0ab5cf9b46
Issue #15181 : importlib bytecode is unsigned and shouldn't have negative numbers.
This fixes a compiler warning with suncc.
14 years ago
Eric V. Smith
e51a36922f
Fixes issue 15039: namespace packages are no longer imported in preference to modules of the same name.
14 years ago
Antoine Pitrou
310f95b04d
A better repr() for FileFinder
14 years ago
Antoine Pitrou
e67f48ce5e
Issue #14928 : Fix importlib bootstrap issues by using a custom executable (Modules/_freeze_importlib) to build Python/importlib.h.
14 years ago
Antoine Pitrou
1d25b6f04a
Issue #15103 : remove the NUL character (serving as a Mercurial binary marker) from Python/importlib.h.
Instead the email notification hook uses a configuration option to omit importlib.h diffs.
14 years ago
Antoine Pitrou
2d9db1dfce
Try to fix issue #15086 : build failure on Ubuntu shared buildbot.
14 years ago
Brett Cannon
99d776fdf4
Update importlib.h by touching Lib/importlib/_bootstrap.py.
14 years ago
Nick Coghlan
5c6eba3a93
Tweak importlib._bootstrap to avoid zero-argument super so I can work on issue #14857 without breaking imports
14 years ago
Brett Cannon
d785cb3955
Remove some redundant decorators.
14 years ago
Eric V. Smith
984b11f88f
issue 14660: Implement PEP 420, namespace packages.
14 years ago
Antoine Pitrou
ea3eb88bca
Issue #9260 : A finer-grained import lock.
Most of the import sequence now uses per-module locks rather than the
global import lock, eliminating well-known issues with threads and imports.
14 years ago
Antoine Pitrou
b84bc7a7ce
Avoid "warning: no newline at end of file" in importlib.h.
14 years ago
Benjamin Peterson
6ecf8ce364
apparently importlib.h wants to be updated
14 years ago
Brett Cannon
c049952de7
Issue #13959 : Have
importlib.abc.FileLoader.load_module()/get_filename() and
importlib.machinery.ExtensionFileLoader.load_module() have their
single argument be optional as the loader's constructor has all the
ncessary information.
This allows for the deprecation of
imp.load_source()/load_compile()/load_package().
14 years ago
Brett Cannon
44ec91f6a5
Update importlib.h
14 years ago
Antoine Pitrou
6efa50a384
Issue #14583 : Fix importlib bug when a package's __init__.py would first import one of its modules then raise an error.
14 years ago
Brett Cannon
feccc09952
Clean up a docstring.
14 years ago
Brett Cannon
a6685e8d36
update importlib.h
14 years ago
Brett Cannon
2657df4744
Issue #13959 : Re-implement imp.get_suffixes() in Lib/imp.py.
This introduces a new function, imp.extension_suffixes(), which is
currently undocumented. That is forthcoming once issue #14657 is
resolved and how to expose file suffixes is decided.
14 years ago
Brett Cannon
efad00d520
Issue #14646 : __import__() now sets __loader__ if need be.
importlib.util.module_for_loader also will set __loader__ along with
__package__. This is in conjunction to a forthcoming update to PEP 302
which will make these two attributes required for loaders to set.
14 years ago
Brett Cannon
fea73efc9e
Issue #14605 : Don't error out if get_importer() returns None.
14 years ago
Brett Cannon
aa93642a35
Issue #14605 : Use None in sys.path_importer_cache to represent no
finder instead of using some (now non-existent) implicit finder.
14 years ago
Brett Cannon
ce418b448f
Issue #14605 : Stop having implicit entries for sys.meta_path.
ImportWarning is raised if sys.meta_path is found to be empty.
14 years ago
Brett Cannon
e0d88a173c
Issue #14605 : Make explicit the entries on sys.path_hooks that used to
be implicit.
Added a warning for when sys.path_hooks is found to be empty. Also
changed the meaning of None in sys.path_importer_cache to represent
trying sys.path_hooks again (an interpretation of previous semantics).
Also added a warning for when None was found.
The long-term goal is for None in sys.path_importer_cache to represent
the same as imp.NullImporter: no finder found for that sys.path entry.
14 years ago
Brett Cannon
f96bb2f9af
Update importlib.h
14 years ago
Marc-Andre Lemburg
7541c8ea37
Issue #14605 and #14642 :
Issue a warning in case Python\importlib.h needs to be rebuilt,
but there's no Python interpreter around to freeze the bootstrap
script.
14 years ago
Marc-Andre Lemburg
4fe29c9657
Issue #14605 : Rename _SourcelessFileLoader to SourcelessFileLoader.
This time also recreating the Python/importlib.h file to make
make happy. See the ticket for details.
14 years ago
Brett Cannon
938d44d59c
Issue #14605 : Expose importlib.abc.FileLoader and
importlib.machinery.(FileFinder, SourceFileLoader,
_SourcelessFileLoader, ExtensionFileLoader).
This exposes all of importlib's mechanisms that will become public on
the sys module.
14 years ago
Brett Cannon
5c903e6ee1
Issue #13959 : Continue to try to accomodate altsep in importlib by not
ignoring altsep if it already exists on a path when doing a join.
14 years ago
Brett Cannon
cf649958f7
Revert to os.path.join() semantics for path manipulation in importlib
which is different than what imp.cache_from_source() operates on.
14 years ago
Brett Cannon
6c802b8491
Update importlib.h
14 years ago
Brett Cannon
0d05a7698b
Have importlib look for pre-existing path separators when joining
paths.
14 years ago
Brett Cannon
2f92389d5c
Don't worry about moving imp.get_tag() over to Lib/imp.py.
14 years ago
Brett Cannon
a64faf0771
Issue #13959 : Re-implement imp.source_from_cache() in Lib/imp.py.
14 years ago
Brett Cannon
ea59dbff16
Issue #13959 : Re-implement imp.cache_from_source() in Lib/imp.py.
14 years ago
Brett Cannon
ed672d6872
Make path manipulation more robust for platforms with alternative path
separators.
14 years ago
Brett Cannon
24117a748b
Issue #13959 : Keep imp.get_magic() in C code, but cache in importlib
for performance. While get_magic() could move to Lib/imp.py, having to
support PyImport_GetMagicNumber() would lead to equal, if not more, C
code than sticking with the status quo.
14 years ago
Brett Cannon
8ff6baf25b
Issue #14581 : Windows users are allowed to import modules w/o taking
the file suffix's case into account, even when doing a case-sensitive
import.
14 years ago
Benjamin Peterson
665c3b3eec
update importlib...
14 years ago
Benjamin Peterson
d76bc7abac
rollback 005fd1fe31ab (see #14609 and #14582 )
Being able to overload a sys.module entry during import of a module was broken
by this changeset.
14 years ago
Brett Cannon
7bd329d800
Issue #12599 : Be more strict in accepting None vs. a false-like object
in importlib.
Thanks to PJE for pointing out the issue and Nick Coghlan for filing
the bug.
14 years ago
Antoine Pitrou
a938c74751
Avoid compiler warning due to stray \x00
14 years ago
Brett Cannon
c1b3f63653
Try to get hg to treat importlib.h as binary.
14 years ago