summaryrefslogtreecommitdiffstats
path: root/Python/importlib_external.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44626: Merge basic blocks earlier to enable better handling of exit ↵Mark Shannon2021-07-161-2148/+2149
| | | | | blocks without line numbers (GH-27138) (GH-27182) (cherry picked from commit a86f7dae0acf918d54086cb85e5a0b0bedeedce7)
* bpo-44297: Fix missing line number in generator expressions (GH-26821)Mark Shannon2021-06-211-958/+958
| | | | | * Make sure that line number is set when entering comprehension scope in compiler. (cherry picked from commit 82e5c28af7049c4f5343c808f172cbe2e145f49b)
* [3.10] bpo-44298: Backport #26513 to 3.10 (#26516)Mark Shannon2021-06-031-1176/+1175
| | | | | * Backport 937cebc93 to 3.10 * Update importlib
* bpo-43754: Eliminate bindings for partial pattern matches (GH-25229)Brandt Bucher2021-05-021-110/+110
|
* bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719)Mark Shannon2021-04-301-1643/+1644
| | | * Set line number of __exit__ call in a with statement to be that of the with keyword.
* bpo-42739: Don't use sentinels to mark end of line table. (GH-25657)Mark Shannon2021-04-291-2405/+2391
| | | | | * Add length parameter to PyLineTable_InitAddressRange and doen't use sentinel values at end of table. Makes the line number table more robust. * Update PyCodeAddressRange to match PEP 626.
* bpo-38605: Revert making 'from __future__ import annotations' the default ↵Pablo Galindo2021-04-211-110/+110
| | | | | | (GH-25490) This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
* bpo-41323: compiler: Reuse tuple in constant tuple folding (GH-25419)Inada Naoki2021-04-161-2083/+2083
|
* bpo-43105: Importlib now resolves relative paths when creating module spec ↵Steve Dower2021-04-071-2436/+2494
| | | | objects from file locations (GH-25121)
* bump the bytecode magic number (GH-25225)Dennis Sweeney2021-04-061-1/+1
|
* bpo-42135: Deprecate implementations of find_module() and find_loader() ↵Brett Cannon2021-04-061-2003/+2035
| | | | (GH-25169)
* bpo-43683: Handle generator entry in bytecode (GH-25138)Mark Shannon2021-04-061-2584/+2585
| | | | | | * Handle check for sending None to starting generator and coroutine into bytecode. * Document new bytecode and make it fail gracefully if mis-compiled.
* bpo-27129: Update magic numbers and bootstrapping for GH-25069 (GH-25172)Dennis Sweeney2021-04-041-1/+1
| | | | | | | * Update magic numbers and bootstrapping for GH-25069 * add blurb Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)Brett Cannon2021-04-021-523/+528
|
* bpo-27129: Use instruction offsets, not byte offsets, in bytecode and ↵Mark Shannon2021-04-011-2638/+2635
| | | | | | | internally. (GH-25069) * Use instruction offset, rather than bytecode offset. Streamlines interpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps. * Change some uses of PyCode_Addr2Line to PyFrame_GetLineNumber
* bpo-42134: Raise ImportWarning when calling find_module() in the import ↵Brett Cannon2021-03-301-515/+523
| | | | system (GH-25044)
* bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)Brett Cannon2021-03-261-696/+704
|
* bpo-39316: Make sure that attribute accesses and stores, including method ↵Mark Shannon2021-03-141-2/+2
| | | | calls, conform to PEP 626. (GH-24859)
* bpo-42129: Add support for resources in namespaces (GH-24670)Jason R. Coombs2021-03-041-730/+742
| | | | | * Unify behavior in ResourceReaderDefaultsTests and align with the behavior found in importlib_resources. * Equip NamespaceLoader with a NamespaceReader. * Apply changes from importlib_resources 5.0.4
* bpo-42128: Structural Pattern Matching (PEP 634) (GH-22917)Brandt Bucher2021-02-261-109/+109
| | | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Talin <viridia@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-42217: compiler: merge same co_code and co_linetable objects (GH-23056)Inada Naoki2021-02-101-2254/+2240
|
* bpo-42908: Mark cleanup code at end of try-except and with artificial (#24202)Mark Shannon2021-01-131-2245/+2244
| | | | | | | | | * 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-42823: Fix frame lineno when frame.f_trace is set (GH-24099)Mark Shannon2021-01-051-1134/+1134
| | | | | | | | | * Add test for frame.f_lineno with/without tracing. * Make sure that frame.f_lineno is correct regardless of whether frame.f_trace is set. * Update importlib * Add NEWS
* bpo-42810: Mark jumps at end of if and try statements as artificial. (GH-24091)Mark Shannon2021-01-041-1239/+1239
| | | | | | | * 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-2441/+2443
|
* bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)Mark Shannon2020-12-211-2404/+2407
| | | | | | | * Mark reraise after except blocks as artificial. * Update importlib * Update dis test.
* bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly ↵Mark Shannon2020-12-171-138/+138
| | | | | | | | | 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-1069/+1070
| | | | statements conform to PEP 626. (GH-23743)
* bpo-42635: Mark JUMP_ABSOLUTE at end of 'for' loop as artificial to avoid ↵Mark Shannon2020-12-141-2011/+2011
| | | | spurious line events. (GH-23761)
* bpo-26131: Deprecate usage of load_module() (GH-23469)Brett Cannon2020-12-041-85/+85
| | | Raise an ImportWarning when the import system falls back on load_module(). As for implementations of load_module(), raise a DeprecationWarning.
* bpo-42246: Don't forget the entry block when ensuring that all exits have a ↵Mark Shannon2020-12-041-3/+3
| | | | | line number (GH-23636) Don't forget the entry block when ensuring that all exits have a line number.
* bpo-42246: Make sure that line number is correct after a return, as required ↵Mark Shannon2020-12-021-2502/+2500
| | | | | by PEP 626 (GH-23495) Make sure that line number is correct after a return, as defined by PEP 626.
* bpo-42202: Store func annotations as a tuple (GH-23316)Yurii Karabas2020-11-251-109/+109
| | | | | | | | | | | | | Reduce memory footprint and improve performance of loading modules having many func annotations. >>> sys.getsizeof({"a":"int","b":"int","return":"int"}) 232 >>> sys.getsizeof(("a","int","b","int","return","int")) 88 The tuple is converted into dict on the fly when `func.__annotations__` is accessed first. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-42403: Use @staticmethod in importlib (GH-23395)Victor Stinner2020-11-201-1631/+1631
| | | | | | | | | | | | | Use @staticmethod on methods using @classmethod but don't use their cls parameter on the following classes: * BuiltinImporter * FrozenImporter * WindowsRegistryFinder * PathFinder Leave methods using @_requires_builtin or @_requires_frozen unchanged, since this decorator requires the wrapped method to have an extra parameter (cls or self).
* bpo-42403: Simplify importlib external bootstrap (GH-23397)Victor Stinner2020-11-191-2675/+2635
| | | | | | | Simplify the importlib external bootstrap code: importlib._bootstrap_external now uses regular imports to import builtin modules. When it is imported, the builtin __import__() function is already fully working and so can be used to import builtin modules like sys.
* bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267)Mark Shannon2020-11-171-2411/+2413
| | | Make sure that CFG from compiler front-end is correct. Be a bit more aggressive in the compiler back-end.
* bpo-42246: Eliminate jumps to exit blocks by copying those blocks. (#23251)Mark Shannon2020-11-121-2502/+2501
| | | * Compiler: eliminate jumps to short exit blocks by copying.
* Bump magic number. (GH-23245)Mark Shannon2020-11-121-111/+111
|
* bpo-42246: Partial implementation of PEP 626. (GH-23113)Mark Shannon2020-11-121-2322/+2344
| | | * Implement new line number table format, as defined in PEP 626.
* bpo-38605: bump the magic number for 'annotations' future (#22630)Batuhan Taskaya2020-10-101-111/+111
|
* bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517)Mark Shannon2020-07-301-2450/+2447
| | | * Move 'peephole' optimizations into compile.c and perform them directly on the CFG.
* bpo-41076: Pre-feed the parser with the f-string expression location (GH-21054)Lysandros Nikolaou2020-06-271-2186/+2186
| | | This commit changes the parsing of f-string expressions with the new parser. The parser gets pre-fed with the location of the expression itself (not the f-string, which was what we were doing before). This allows us to completely skip the shifting of the AST nodes after the parsing is completed.
* bpo-39791 native hooks for importlib.resources.files (GH-20576)Jason R. Coombs2020-06-081-1117/+1072
| | | | | | | | | | | | | | | | | | | | | | | | | * 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-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-221-3/+4
| | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40050: Fix importlib._bootstrap_external (GH-19135)Victor Stinner2020-03-241-1736/+1729
| | | | | | Remove two unused imports: _thread and _weakref. Avoid creating a new winreg builtin module if it's already available in sys.modules. The winreg module is now stored as "winreg" rather than "_winreg".
* bpo-39987: Simplify setting lineno in the compiler. (GH-19037)Serhiy Storchaka2020-03-171-1982/+1980
|
* bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627)idomic2020-03-091-2626/+2634
| | | | | The importlib module now ignores the PYTHONCASEOK environment variable when the -E or -I command line options are being used.
* Revert "bpo-38691 Added a switch to ignore PYTHONCASEOK when -E or -I flags ↵Victor Stinner2020-02-191-2649/+2646
| | | | | passed (#18314)" (GH-18553) This reverts commit d83b6600b25487e4ebffd7949d0f478de9538875.
* bpo-38691 Added a switch to ignore PYTHONCASEOK when -E or -I flags passed ↵idomic2020-02-171-2646/+2649
| | | | | | | | | | | | | | | | | | | | | (#18314) * Hard reset + cherry piciking the changes. * 📜🤖 Added by blurb_it. * Added @vstinner News * Update Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst Co-Authored-By: Victor Stinner <vstinner@python.org> * Hard reset to master * Hard reset to master + latest changes Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39320: Handle unpacking of **values in compiler (GH-18141)Mark Shannon2020-01-271-2149/+2151
| | | | | | | | | | | | | * Add DICT_UPDATE and DICT_MERGE bytecodes. Use them for ** unpacking. * Remove BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL, as they are now unused. * Update magic number for ** unpacking opcodes. * Update dis.rst to incorporate new bytecodes. * Add blurb entry.