| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-30876: Relative import from unloaded package now reimports the package
instead of failing with SystemError.
Relative import from non-package now fails with ImportError rather than
SystemError.
(cherry picked from commit 8a9cd20edca7d01b68292036029ae3735ce65edd)
* bpo-18018: Import raises ImportError instead of SystemError if a relative
import is attempted without a known parent package.
* bpo-26367: importlib.__init__() raises ImportError like
builtins.__import__() when ``level`` is specified but without an accompanying
package specified.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a test to check the current MAGIC_NUMBER against the
expected number for the release if the current release is
at candidate or final level. On test failure, describe to
the developer the procedure for changing the magic number.
This ensures that pre-merge CI will automatically pick up
on magic number changes in maintenance releases (and
explain why those are problematic), rather than relying on
all core developers to be aware of the implications of
such changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bpo-27286 fixed a problem where BUILD_MAP_UNPACK_WITH_CALL could
be emitted with an incorrect oparg value, causing the eval loop
to access the wrong stack entry when attempting to read the
function name.
The associated magic number change caused significant problems when
attempting to upgrade to 3.5.3 for anyone that relies on pre-cached
bytecode remaining valid across maintenance releases.
This patch restores the ability to import legacy bytecode generated
by 3.5.0, 3.5.1 or 3.5.2, and modifies the eval loop to
avoid any harmful consequences from the potentially malformed legacy
bytecode.
Original import patch by Petr Viktorin, eval loop patch by Serhiy Storchaka,
and tests and integration by Nick Coghlan.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Multi-phase extension module import now correctly allows the
``m_methods`` field to be used to add module level functions
to instances of non-module types returned from ``Py_create_mod``.
Patch by Xiang Zhang.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Windows.
Originally only b'PYTHONCASEOK' was being checked for in os.environ,
but that won't work under Windows where all environment variables are
strings (on OS X they are bytes).
Thanks to Eryk Sun for the bug report.
|
|
|
|
| |
lazy-loaded module was already in sys.modules.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
importlib.util.LazyLoader.
The class was checking its argument as to whether its implementation
of create_module() came directly from importlib.abc.Loader. The
problem is that the classes coming from imoprtlib.machinery do not
directly inherit from the ABC as they come from _frozen_importlib.
Because the documentation has always said that create_module() was
ignored, the check has simply been removed.
|
|
|
|
|
|
|
| |
'level' is specified but no __package__.
This brings the function inline with builtins.__import__(). Thanks to
Manuel Jacob for the patch.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Known limitations of the current implementation:
- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet
The leak is most visible by running:
./python -m test -R3:3 test_importlib
However, you can also see it by running:
./python -X showrefcount
Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
|
|
|
|
|
| |
assertWarnsRegex() assertments now check the type of the first argument
to prevent possible user error. Based on patch by Daniel Wagner-Hall.
|
| |
|
| |
|
|
|
|
|
|
| |
The concept of .pyo files no longer exists. Now .pyc files have an
optional `opt-` tag which specifies if any extra optimizations beyond
the peepholer were applied.
|
| |
|
|
|
|
|
|
| |
integer.
Thanks to Serhiy Storchaka and Martin Panter for the suggestions.
|
|
|
|
|
|
| |
allowing the deletion of the cwd.
Thanks to Martin Panter for the initial fix.
|
|
|
|
|
|
|
|
|
| |
importlib.abc.Loader.exec_module() is also defined.
Before this change, create_module() was optional **and** could return
None to trigger default semantics. This change now reduces the
options for choosing default semantics to one and in the most
backporting-friendly way (define create_module() to return None).
|
| |
|
| |
|
|
|
|
|
|
| |
working directory no longer exists.
Thanks to Martin Panter for the bug report.
|
|
|
|
| |
Patch by Claudiu Popa, review by Martin v. Löwis.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Adds `load_package_tests` function to test.support, uses it in test_asyncio,
test_email, test_json, test_tools, test_importlib and all test_importlib
sub-packages to implement test discovery.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
Python is built without threads.
|
| |
| |
| |
| |
| |
| | |
Along the way, dismantle importlib._bootstrap._SpecMethods as it was
no longer relevant and constructing the new function required
partially dismantling the class anyway.
|
| | |
|
| | |
|
| | |
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
module.
|
| | |
|
| | |
|
|/ |
|
|\ |
|
| |
| |
| |
| | |
Patch by Berker Peksag.
|
| |
| |
| |
| | |
to avoid reporting success on empty tests.
|
| |
| |
| |
| |
| |
| | |
PathEntryFinder instances which only define find_module().
Reported by Yukihiro Nakadaira.
|