| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Replaced the period with a comma.
Automerge-Triggered-By: @Mariatta
|
|
|
|
|
|
|
| |
The importlib.metadata documentation uses hardcoded links to internal
pages. This results in minor rendering issues. This change replaces
the hardcoded links with suitable Sphinx roles.
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
None (#10376)
Namespace packages _bootstrap.ModuleSpec.loader attributes are no longer `None` _after_ calling the importlib._bootstrap._init_module_attrs function.
See:
* https://stackoverflow.com/questions/52869541/namespace-package-spec-loader-and-loader-attributes-not-set-to-none
* https://bugs.python.org/issue35181
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* document relative imports
* 📜🤖 Added by blurb_it.
* fix indentation error
* remove indentation
* Document relative imports
* Document relative imports
* remove from ...package
* Document relative imports
* remove trailing space
* Document relative imports
* Document relative imports
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python now supports checking bytecode cache up-to-dateness with a hash of the
source contents rather than volatile source metadata. See the PEP for details.
While a fairly straightforward idea, quite a lot of code had to be modified due
to the pervasiveness of pyc implementation details in the codebase. Changes in
this commit include:
- The core changes to importlib to understand how to read, validate, and
regenerate hash-based pycs.
- Support for generating hash-based pycs in py_compile and compileall.
- Modifications to our siphash implementation to support passing a custom
key. We then expose it to importlib through _imp.
- Updates to all places in the interpreter, standard library, and tests that
manually generate or parse pyc files to grok the new format.
- Support in the interpreter command line code for long options like
--check-hash-based-pycs.
- Tests and documentation for all of the above.
|
|
|
| |
bpo-31936
|
|
|
|
| |
bpo-31799: Make module.__spec__ more discoverable
|
| |
|
|
|
|
| |
Replace `an ModuleNotFoundError` with `a ModuleNotFoundError`.
Replace `an path` with `a path`.
|
| |
|
| |
|
|
|
|
| |
Mention that an ImportError is raised when exec_module() is defined, but
create_module() is not.
|
|
|
| |
Add a reference to create_module(), in the first versionadded of section Loaders.
|
| |
|
|\ |
|
| |
| |
| |
| | |
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.
|