| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
by way of a global variable keeping a reference to a traceback.
Should fix some buildbot failures.
|
|
|
|
| |
also the module imported as importlib._bootstrap.
|
|
|
|
|
|
|
|
|
| |
module name into consideration when determining whether a module is a
package or not. This prevents importing a module's __init__ module
directly and having it considered a package, which can lead to
duplicate sub-modules.
Thanks to Ronan Lamy for reporting the bug.
|
|
|
|
| |
issue #14857 without breaking imports
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Most of the import sequence now uses per-module locks rather than the
global import lock, eliminating well-known issues with threads and imports.
|
| |
|
|
|
|
|
|
| |
The long-term goal is to deprecate imp.find_module() in favour of this
API, but it will take some time as some APIs explicitly return/use what
imp.find_module() returns.
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
|
|
|
|
|
| |
importlib.machinery that provide the suffix details for import.
The attributes were not put on imp so as to compartmentalize
everything importlib needs for setting up imports in
importlib.machinery.
This also led to an indirect deprecation of inspect.getmoduleinfo() as
it directly returned imp.get_suffix's returned tuple which no longer
makes sense.
|
|
|
|
| |
import machinery is no longer implicit.
|
|
|
|
| |
import one of its modules then raise an error.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
finder instead of using some (now non-existent) implicit finder.
|
|
|
|
| |
ImportWarning is raised if sys.meta_path is found to be empty.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Issue a warning in case Python\importlib.h needs to be rebuilt,
but there's no Python interpreter around to freeze the bootstrap
script.
|
|
|
|
|
| |
This time also recreating the Python/importlib.h file to make
make happy. See the ticket for details.
|
|
|
|
| |
the buildbots to fail.
|
| |
|
|
|
|
|
|
|
|
| |
importlib.machinery.(FileFinder, SourceFileLoader,
_SourcelessFileLoader, ExtensionFileLoader).
This exposes all of importlib's mechanisms that will become public on
the sys module.
|
|
|
|
| |
ignoring altsep if it already exists on a path when doing a join.
|
|
|
|
| |
which is different than what imp.cache_from_source() operates on.
|
|
|
|
| |
variable name.
|
|
|
|
| |
paths.
|
| |
|
| |
|
| |
|
|
|
|
| |
separators.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
importlib.test.import_ using builtins.__import__() instead of just the
relative import tests.
|
|
|
|
|
| |
the file suffix's case into account, even when doing a case-sensitive
import.
|
|
|
|
| |
sure finders from importlib are used instead of _frozen_importlib.
|
| |
|
|
|
|
|
| |
Being able to overload a sys.module entry during import of a module was broken
by this changeset.
|
|
|
|
|
|
|
| |
in importlib.
Thanks to PJE for pointing out the issue and Nick Coghlan for filing
the bug.
|
|
|
|
|
|
| |
or __name__ are not set in globals.
Thanks to Stefan Behnel for the bug report.
|
|
|
|
|
|
|
| |
rewriting functionality in pure Python.
To start, imp.new_module() has been rewritten in pure Python, put into
importlib (privately) and then publicly exposed in imp.
|
|\ |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
of sys.modules when possible.
This is being done for two reasons. One is to gain a little bit of
performance by skipping an unnecessary dict lookup in sys.modules. But
the other (and main) reason is to be a little bit more clear in how
things should work from the perspective of import's interactions with
loaders. Otherwise loaders can easily forget to return the module even
though PEP 302 explicitly states they are expected to return the module
they loaded.
|
|
|
|
|
| |
__import__('mod', {'__packaging__': 'pkg', level=1) w/o properly (and
thus not segfaulting).
|
| |
|
|
|
|
|
|
|
| |
importlib._bootstrap is now frozen into Python/importlib.h and stored
as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen
code along with sys and imp and then uses _frozen_importlib._install()
to set builtins.__import__() w/ _frozen_importlib.__import__().
|