summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap_external.py
Commit message (Collapse)AuthorAgeFilesLines
* Produce cleaner bytecode for 'with' and 'async with' by generating separate ↡Mark Shannon2019-11-211-1/+3
| | | | | | code for normal and exceptional paths. (#6641) Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication. Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
* bpo-38121: Sync importlib.metadata with 0.22 backport (GH-15993)Jason R. Coombs2019-09-121-49/+3
| | | | | | * bpo-38121: Sync importlib.metadata with 0.22 backport * πŸ“œπŸ€– Added by blurb_it.
* bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)Jason R. Coombs2019-09-101-10/+8
| | | https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21
* bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)Zackery Spytz2019-08-251-1/+2
| | | | Fix assert statement misbehavior if AssertionError is shadowed.
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-241-1/+2
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.
* bpo-37697: Sync with importlib_metadata 0.19 (#14993)Jason R. Coombs2019-07-281-10/+19
| | | | | | | | * bpo-37697: Sync with importlib_metadata 0.19 * Run make regen-importlib * πŸ“œπŸ€– Added by blurb_it.
* Fix typos in docs, comments and test assert messages (#14872)Min ho Kim2019-07-211-1/+1
|
* bpo-37593: Swap the positions of posonlyargs and args in the constructor of ↡Pablo Galindo2019-07-141-1/+3
| | | | | ast.parameters nodes (GH-14778) https://bugs.python.org/issue37593
* bpo-35224: Bump the pyc magic number by 1 instead of by 10 in last ↡Pablo Galindo2019-06-231-2/+2
| | | | modification (GH-14320)
* bpo-35224: Bump the pyc magic number after the change in MAP_ADD (GH-14313)Pablo Galindo2019-06-221-1/+3
|
* bpo-34632: Add importlib.metadata (GH-12547)Jason R. Coombs2019-05-241-0/+52
| | | Add importlib.metadata module as forward port of the standalone importlib_metadata.
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-2/+6
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)Anthony Sottile2019-03-081-0/+3
|
* bpo-35024: Remove redundant and possibly incorrect verbose message after ↡Quentin Agren2018-10-261-1/+0
| | | | | | | | | writing '.pyc' (GH-9998) Since `SourceFileLoader.set_data()` catches exceptions raised by `_write_atomic()` and logs an informative message consequently, always logging successful outcome in 'SourceLoader.get_code()' seems redundant. https://bugs.python.org/issue35024
* importlib: Fix typo in SourceLoader.path_stats docstring (GH-10052)Quentin2018-10-251-3/+4
|
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-181-10/+16
|
* bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. ↡Carl Meyer2018-06-161-10/+52
| | | | | | | | | | | | | | | (GH-6834) In some development setups it is inconvenient or impossible to write bytecode caches to the code tree, but the bytecode caches are still useful. The PYTHONPYCACHEPREFIX environment variable allows specifying an alternate location for cached bytecode files, within which a directory tree mirroring the code tree will be created. This cache tree is then used (for both reading and writing) instead of the local `__pycache__` subdirectory within each source directory. Exposed at runtime as sys.pycache_prefix (defaulting to None), and can be set from the CLI as "-X pycache_prefix=path". Patch by Carl Meyer.
* bpo-32911: Add the historical note about the magic number. (GH-7273)Serhiy Storchaka2018-05-311-0/+2
|
* bpo-33169: Remove values of `None` from sys.path_importer_cache when ↡Brett Cannon2018-04-061-2/+4
| | | | | invalidating caches (GH-6402) An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-231-1/+2
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↡Serhiy Storchaka2018-02-221-1/+2
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32838: Fix Python versions in the table of magic numbers. (#5658)Serhiy Storchaka2018-02-221-32/+35
|
* bpo-32303 - Consistency fixes for namespace loaders (#5481)Barry Warsaw2018-02-021-3/+3
| | | | | | | * Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages. * Make sure ``__spec__.origin` matches ``__file__`` for namespace packages. https://bugs.python.org/issue32303 https://bugs.python.org/issue32305
* bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)Mark Shannon2018-01-301-1/+2
|
* Implement the get_resource_reader() API for file system imports (#5168)Barry Warsaw2018-01-151-6/+32
|
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-55/+142
| | | | | | | | | | | | | | | | | | | | | | | | | 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-31709: Update importlib magic (#3906)Yury Selivanov2017-10-061-1/+2
|
* Trivial cleanups following bpo-31370 (#3649)Antoine Pitrou2017-09-181-5/+1
| | | | | | * Trivial cleanups following bpo-31370 * Also cleanup the "importlib._bootstrap_external" module
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-161-4/+4
|
* Issue #26110: Add LOAD_METHOD/CALL_METHOD opcodes.Yury Selivanov2016-12-141-1/+2
| | | | | | | Special thanks to INADA Naoki for pushing the patch through the last mile, Serhiy Storchaka for reviewing the code, and to Victor Stinner for suggesting the idea (originally implemented in the PyPy project).
* Issue #28896: Disable WindowsRegistryFinder by default.Steve Dower2016-12-121-2/+0
|
* Issue #23722: improve __classcell__ compatibilityNick Coghlan2016-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | | Handling zero-argument super() in __init_subclass__ and __set_name__ involved moving __class__ initialisation to type.__new__. This requires cooperation from custom metaclasses to ensure that the new __classcell__ entry is passed along appropriately. The initial implementation of that change resulted in abruptly broken zero-argument super() support in metaclasses that didn't adhere to the new requirements (such as Django's metaclass for Model definitions). The updated approach adopted here instead emits a deprecation warning for those cases, and makes them work the same way they did in Python 3.5. This patch also improves the related class machinery documentation to cover these details and to include more reader-friendly cross-references and index entries.
* Issue #28257: Improved error message when pass a non-iterable asSerhiy Storchaka2016-10-021-1/+2
| | | | a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
* Issue #23722: Initialize __class__ from type.__new__()Nick Coghlan2016-09-111-2/+3
| | | | | | | | | The __class__ cell used by zero-argument super() is now initialized from type.__new__ rather than __build_class__, so class methods relying on that will now work correctly when called from metaclass methods during class creation. Patch by Martin Teichmann.
* Issue #24320: Drop an old setuptools-induced hack.Eric Snow2016-09-091-5/+0
|
* Rework CALL_FUNCTION* opcodesVictor Stinner2016-09-091-1/+2
| | | | | | | | | | | | | | | | | | | Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more efficient bytecode: * CALL_FUNCTION now only accepts position arguments * CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys of keyword arguments are packed into a constant tuple. * CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for positional and keyword arguments. CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed. 2 tests of test_traceback are currently broken: skip test, the issue #28050 was created to track the issue. Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka and Victor Stinner.
* Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov2016-09-091-1/+3
| | | | Patch by Ivan Levkivskyi.
* Issue #26667: Add path-like object support to importlib.util.Brett Cannon2016-09-081-0/+4
|
* Issue #27078: Added BUILD_STRING opcode. Optimized f-strings evaluation.Serhiy Storchaka2016-09-061-2/+3
|
* Merge for #27083Brett Cannon2016-07-161-4/+10
|\
| * Fix regressions introduced by fixes for issue #27083.Brett Cannon2016-07-161-4/+10
| |
* | Merge for #27083Brett Cannon2016-07-151-1/+2
|\ \ | |/
| * Issue #27083: Respect the PYTHONCASEOK environment variable underBrett Cannon2016-07-151-1/+2
| | | | | | | | | | | | | | | | | | | | 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.
* | Issue #26972: Fix some mistakes in importlib-related docstrings.Brett Cannon2016-07-081-9/+9
| | | | | | | | Thanks to Oren Milman for the patch.
* | Issue #27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes.Serhiy Storchaka2016-06-121-3/+5
| | | | | | | | Patch by Demur Rumed.
* | Comment fixes extracted from patch by Demur Rumed.Serhiy Storchaka2016-06-121-4/+0
| |
* | Issue #27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. CallingSerhiy Storchaka2016-06-121-0/+1
|\ \ | |/ | | | | | | function with generalized unpacking (PEP 448) and conflicting keyword names could cause undefined behavior.
| * Issue #27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. CallingSerhiy Storchaka2016-06-121-1/+2
| | | | | | | | | | function with generalized unpacking (PEP 448) and conflicting keyword names could cause undefined behavior.
* | Issue #27140: Added BUILD_CONST_KEY_MAP opcode.Serhiy Storchaka2016-06-111-1/+2
| |