| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
(cherry picked from commit ea6a28c9f7e4baa5fe775cebce697a14a7d7da8b)
Co-authored-by: Andrés Delfino <adelfino@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit ddb961d2abe5d5fde76d85b21a77e4e91e0043ad)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 441d945eb33f8dc130b268ebfa11315b98a2433c)
Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
|
| |
|
|
| |
bpo-31799: Make module.__spec__ more discoverable
(cherry picked from commit 191e3138200906e43cba9347177914325b54843f)
|
| |
|
| |
(cherry picked from commit 60dbed18509f99af8eaa685d9736f954b8d621fb)
|
| |
|
|
|
| |
Replace `an ModuleNotFoundError` with `a ModuleNotFoundError`.
Replace `an path` with `a path`.
(cherry picked from commit 9c972b578002cc3bbbf2ebf2856c69de892bc9e2)
|
| |
|
| |
(cherry picked from commit c138d84b8d27d338872587aae69a73d8f9d16641)
|
| |
|
| |
(cherry picked from commit 1f5639c77f736c18fb5a85b4a1850121e25c788e)
|
| |
|
| |
(cherry picked from commit 6b4a5f45e2df524174a97832571c82c76a3d424a)
|
| |
|
| |
(cherry picked from commit 46ce7599af82a929506baeaaee5c149970440c4c)
|
| | |
|
| |\ |
|
| | |
| |
| |
| | |
Thanks to Xiang Zhang for the patch.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
In a previous change, __spec__.parent was prioritized over
__package__. That is a backwards-compatibility break, but we do
eventually want __spec__ to be the ground truth for module details. So
this change reverts the change in semantics and instead raises an
ImportWarning when __package__ != __spec__.parent to give people time
to adjust to using spec objects.
|
| |/
|
|
|
|
|
|
| |
not defined for a relative import.
This is the start of work to try and clean up import semantics to rely
more on a module's spec than on the myriad attributes that get set on
a module. Thanks to Rose Ames for the patch.
|
| |
|
|
|
|
| |
statements search for __import__ in the global scope.
Thanks to Sergei Lebedev for finding the documentation bug.
|
| |\
| |
| |
| |
| |
| |
| | |
imp.reload() was deprecated in Python 3.4 and changed to call
importlib.reload().
Patch by Petr Viktorin.
|
| | |
| |
| |
| |
| |
| |
| | |
imp.reload() was deprecated in Python 3.4 and changed to call
importlib.reload().
Patch by Petr Viktorin.
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |/
|
|
| |
Thanks to Jon Poler for pointing this out.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| | |
These mistakes were introduced by the initial PEP 451 merge.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Forgot to raise ModuleNotFoundError when None is found in sys.modules.
This led to introducing the C function PyErr_SetImportErrorSubclass()
to make setting ModuleNotFoundError easier.
Also updated the reference docs to mention ModuleNotFoundError
appropriately. Updated the docs for ModuleNotFoundError to mention the
None in sys.modules case.
Lastly, it was noticed that PyErr_SetImportError() was not setting an
exception when returning None in one case. That issue is now fixed.
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
otherwise are cut off or have overlapping text.
|
| |/
|
|
|
|
| |
set __loader__ on a module when set to None.
Thanks to Gökcen Eraslan for the fix.
|
| |
|
|
| |
(actually, any non-string or non-bytes type).
|
| |
|
|
| |
Patch by Manuel Pégourié-Gonnard
|
| |
|
|
| |
importer and the simpler 'path finder' is too ambiguous)
|
| | |
|
| |
|
|
| |
with the new import system documentation, and fix various parts of the new docs that weren't quite right given PEP 420 or were otherwise a bit misleading. Also note the key terminology problem still being discussed in the issue
|
| |
|