summaryrefslogtreecommitdiffstats
path: root/Python/importlib_zipimport.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-14678: Update zipimport to support importlib.invalidate_caches() (GH-24159)Desmond Cheong2021-03-081-939/+957
| | | Added an invalidate_caches() method to the zipimport.zipimporter class based on the implementation of importlib.FileFinder.invalidate_caches(). This was done by adding a get_files() method and an _archive_mtime attribute to zipimport.zipimporter to check for updates or cache invalidation whenever the cache of files and toc entry information in the zipimporter is accessed.
* bpo-42908: Mark cleanup code at end of try-except and with artificial (#24202)Mark Shannon2021-01-131-506/+507
| | | | | | | | | * Mark bytecodes at end of try-except as artificial. * Make sure that the CFG is consistent throughout optimiization. * Extend line-number propagation logic so that implicit returns after 'try-except' or 'with' have the correct line numbers. * Update importlib
* bpo-42810: Mark jumps at end of if and try statements as artificial. (GH-24091)Mark Shannon2021-01-041-138/+138
| | | | | | | * Mark jumps at end of if and try statements as artificial. * Update importlib * Add comment explaining the purpose of ADDOP_JUMP_NOLINE.
* bpo-42246: Don't eliminate jumps to jumps, if it will break PEP 626. (GH-23896)Mark Shannon2020-12-231-898/+898
|
* bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)Mark Shannon2020-12-211-865/+869
| | | | | | | * Mark reraise after except blocks as artificial. * Update importlib * Update dis test.
* bpo-24792: Fix zipimporter masking the cause of import errors (GH-22204)Irit Katriel2020-12-191-710/+719
| | | | | zipimport's _unmarshal_code swallows import errors and then _get_module_code doesn't know the cause of the error, and returns the generic, and sometimes incorrect, 'could not find...'. Automerge-Triggered-By: GH:brettcannon
* bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly ↵Mark Shannon2020-12-171-26/+26
| | | | | | | | | after raising or reraising an exception (GH-23803) * Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626. * Update importlib * Add NEWS.
* bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if ↵Mark Shannon2020-12-151-599/+600
| | | | statements conform to PEP 626. (GH-23743)
* Don't generate spurious line number in try-except-finally. (#23760)Mark Shannon2020-12-141-243/+243
|
* bpo-26131: Deprecate usage of load_module() (GH-23469)Brett Cannon2020-12-041-993/+1005
| | | Raise an ImportWarning when the import system falls back on load_module(). As for implementations of load_module(), raise a DeprecationWarning.
* bpo-42246: Make sure that line number is correct after a return, as required ↵Mark Shannon2020-12-021-861/+861
| | | | | by PEP 626 (GH-23495) Make sure that line number is correct after a return, as defined by PEP 626.
* bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267)Mark Shannon2020-11-171-749/+749
| | | Make sure that CFG from compiler front-end is correct. Be a bit more aggressive in the compiler back-end.
* bpo-42131: Add PEP 451-related methods to zipimport (GH-23187)Brett Cannon2020-11-131-943/+990
| | | | | Specifically, find_spec(), create_module(), and exec_module(). Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
* bpo-42246: Eliminate jumps to exit blocks by copying those blocks. (#23251)Mark Shannon2020-11-121-548/+543
| | | * Compiler: eliminate jumps to short exit blocks by copying.
* bpo-42246: Partial implementation of PEP 626. (GH-23113)Mark Shannon2020-11-121-838/+843
| | | * Implement new line number table format, as defined in PEP 626.
* bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)Mark Shannon2020-07-301-452/+451
| | | * Move 'peephole' optimizations into compile.c and perform them directly on the CFG.
* bpo-39791 native hooks for importlib.resources.files (GH-20576)Jason R. Coombs2020-06-081-1051/+933
| | | | | | | | | | | | | | | | | | | | | | | | | * Provide native .files support on SourceFileLoader. * Add native importlib.resources.files() support to zipimporter. Remove fallback support. * make regen-all * 📜🤖 Added by blurb_it. * Move 'files' into the ResourceReader so it can carry the relevant module name context. * Create 'importlib.readers' module and add FileReader to it. * Add zip reader and rely on it for a TraversableResources object on zipimporter. * Remove TraversableAdapter, no longer needed. * Update blurb. * Replace backslashes with forward slashes. * Incorporate changes from importlib_metadata 2.0, finalizing the interface for extension via get_resource_reader. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39987: Simplify setting lineno in the compiler. (GH-19037)Serhiy Storchaka2020-03-171-353/+352
|
* bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)Mark Shannon2020-01-141-917/+914
| | | | | | | | Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
* bpo-39033: Fix NameError in zipimport during hash validation (GH-17588)Xtreak2019-12-151-268/+267
| | | | Patch by Karthikeyan Singaravelan.
* Produce cleaner bytecode for 'with' and 'async with' by generating separate ↵Mark Shannon2019-11-211-491/+494
| | | | | | 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-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)Zackery Spytz2019-08-251-183/+181
| | | | Fix assert statement misbehavior if AssertionError is shadowed.
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-241-5/+5
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.
* bpo-37213: Handle negative line deltas correctly in the peephole optimizer ↵Pablo Galindo2019-06-131-296/+296
| | | | | (GH-13969) The peephole optimizer was not optimizing correctly bytecode after negative deltas were introduced. This is due to the fact that some special values (255) were being searched for in both instruction pointer delta and line number deltas.
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-559/+558
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-819/+828
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)Anthony Sottile2019-01-131-4/+4
|
* bpo-31241: Fix AST node position for list and generator comprehensions. ↵Serhiy Storchaka2018-11-271-201/+201
| | | | | | | | (GH-10633) The lineno and col_offset attributes of AST nodes for list comprehensions, generator expressions and tuples are now point to the opening parenthesis or square brace. For tuples without parenthesis they point to the position of the first item.
* bpo-34100: Merge constants recursively (GH-8341)INADA Naoki2018-11-261-785/+775
| | | | | | | There are some same consts in a module. This commit merges them into single instance. It reduces number of objects in memory after loading modules. https://bugs.python.org/issue34100
* bpo-34726: Fix handling of hash-based pycs in zipimport. (GH-10327)Elvis Pranskevichus2018-11-071-1018/+1055
| | | | | | | | Current support for hash-based bytecode files in `zipimport` is rather sparse, which leads to test failures when the test suite is ran with the ``SOURCE_DATE_EPOCH`` environment variable set. This teaches zipimport to handle hash-based pycs properly.
* bpo-5950: Support reading zips with comments in zipimport (#9548)Zackery Spytz2018-09-251-1006/+1034
| | | * bpo-5950: Support reading zips with comments in zipimport
* bpo-25711: Move _ZipImportResourceReader from importlib to zipimport. (GH-9406)Serhiy Storchaka2018-09-191-866/+986
|
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-181-0/+900