| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit d5a69571f586080af4c29671c47f9c4bc671af7f)
Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 28f84c72b6cee145f9c00e9b999656e9a2517e49)
Co-authored-by: David Gilbertson <gilbertson.david@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
@ericsnowcurrently This PR will change the following:
In the library documentation importlib.rst:
- `module.__package__` can be `module.__name__` for packages;
- `spec.parent` can be `spec.__name__` for packages;
- `spec.loader` is not `None` for namespaces packages.
In the language documentation import.rst:
- `spec.loader` is not `None` for namespace packages.
Automerge-Triggered-By: GH:warsaw
(cherry picked from commit 27f1bd8787d24ac53cc3dc6ea5eb00b8a3499839)
Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit cb115e36e1aba04b90b0ecac6f043e60064ac65b)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
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.
|
|\ \
| |/ |
|
| | |
|