summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap_external.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable ↵Jason R. Coombs2024-03-151-0/+3
| | | | | | | | | | when delegated through PathFinder. (GH-116812) (#116865) * Make MetadataPathFinder a proper classmethod. * In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches. * Add blurb (cherry picked from commit 5f52d20a93908196f74271db8437cc1ba7e1e262)
* gh-91181: drop support for bytes on sys.path (GH-31934)Miss Islington (bot)2022-07-171-1/+1
| | | | | | | | | Support for bytes broke sometime between Python 3.2 and 3.6 and has been broken ever since. Trying to bring back supports is surprisingly difficult in the face of -b and checking for keys in sys.path_importer_cache. Since the support was broken for so long, trying to overcome the difficulty of bringing back the support has been deemed not worth it. Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Brett Cannon <brett@python.org> (cherry picked from commit 6da988a46c8955755624ad9878288d5214fceb4e) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* [3.11] gh-94485: Set line number of module's RESUME instruction to 0 as ↵Łukasz Langa2022-07-051-2/+3
| | | | | | | | | specified by PEP 626 (GH-94552) (GH-94562) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Mark Shannon <mark@hotpy.org> (cherry picked from commit 324d01944d16868b07df9e8eef6987766a31a36d)
* gh-93461: Invalidate sys.path_importer_cache entries with relative paths ↵Miss Islington (bot)2022-06-131-4/+9
| | | | | | | (GH-93653) (cherry picked from commit 09243b898a13f3f61e275c1031143d1225e70916) Co-authored-by: Christian Heimes <christian@python.org>
* gh-91869: Fix tracing of specialized instructions with extended args (GH-91945)Dennis Sweeney2022-04-281-1/+1
|
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-211-1/+1
| | | | | | | | | | | | (GH-91666) * Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
* gh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-32215)Irit Katriel2022-04-151-1/+3
|
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-1/+2
|
* bpo-47120: make JUMP_NO_INTERRUPT relative (GH-32221)Irit Katriel2022-04-051-1/+2
|
* bpo-47186: Replace JUMP_IF_NOT_EG_MATCH by CHECK_EG_MATCH + jump (GH-32309)Irit Katriel2022-04-051-1/+2
|
* bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231)Irit Katriel2022-04-011-1/+2
|
* bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD ↵Irit Katriel2022-03-311-1/+2
| | | | (GH-32115)
* Use low bit of LOAD_GLOBAL's oparg to indicate whether it should push an ↵Mark Shannon2022-03-171-1/+2
| | | | additional NULL. (GH-31933)
* bpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742)Brandt Bucher2022-03-081-1/+2
|
* bpo-46841: Use inline caching for calls (GH-31709)Brandt Bucher2022-03-071-1/+2
|
* Remove trailing spaces (GH-31695)Serhiy Storchaka2022-03-051-1/+1
|
* bpo-46841: Fix error message hacks in `GET_AWAITABLE` (GH-31664)Brandt Bucher2022-03-041-1/+2
|
* bpo-46841: Use inline caching for attribute accesses (GH-31640)Brandt Bucher2022-03-031-1/+3
|
* bpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618)Mark Shannon2022-03-011-1/+1
|
* bpo-46841: Use inline caching for `COMPARE_OP` (GH-31622)Brandt Bucher2022-03-011-1/+2
|
* bpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)Mark Shannon2022-02-281-2/+2
|
* bpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)Brandt Bucher2022-02-281-1/+2
|
* bpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)Brandt Bucher2022-02-251-4/+2
|
* bpo-46329: Streamline calling sequence a bit. (GH-31465)Mark Shannon2022-02-211-1/+2
| | | | | | | | | | | | | | * Move handling of bound-methods to PRECALL. * Remove call_shape.postcall_shrink * Remove call_shape.callable * Remove call_shape.callable. Change CALL oparg to match PRECALL oparg. * Move KW_NAMES before PRECALL. * Update opcode docs in dis.rst
* bpo-46329: Change calling sequence (again) (GH-31373)Mark Shannon2022-02-181-1/+2
| | | | * Change calling sequence: Add PUSH_NULL. Merge PRECALL_FUNCTION and PRECALL_METHOD into PRECALL.
* bpo-46329: Split calls into precall and call instructions. (GH-30855)Mark Shannon2022-01-281-1/+6
| | | | | | | | | | | | | | * Add PRECALL_FUNCTION opcode. * Move 'call shape' varaibles into struct. * Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions. * Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol. * Allow kwnames for specialized calls to builtin types. * Specialize calls to tuple(arg) and str(arg).
* bpo-46528: Simplify the VM's stack manipulations (GH-30902)Brandt Bucher2022-01-261-1/+3
|
* bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723)Mark Shannon2022-01-241-1/+2
| | | | | | | | * Split YIELD_VALUE into ASYNC_GEN_WRAP; YIELD_VALUE for async generators. * Split SEND into SEND; YIELD_VALUE. * Document new opcodes.
* bpo-46409: Make generators in bytecode (GH-30633)Mark Shannon2022-01-201-1/+2
| | | | | | | | | | | | * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing.
* bpo-45923: Handle call events in bytecode (GH-30364)Mark Shannon2022-01-061-1/+6
| | | | * Add a RESUME instruction to handle "call" events.
* bpo-46031: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE (GH-30019)penguin_wwy2022-01-061-1/+2
|
* bpo-46009: Remove GEN_START (GH-30367)Brandt Bucher2022-01-041-1/+2
|
* bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)Irit Katriel2022-01-041-1/+2
| | | | | | * bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE * do not assume that an exception group is truthy
* bpo-46219, 46221: simplify except* implementation following exc_info ↵Irit Katriel2022-01-021-1/+2
| | | | changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. (GH-30289)
* bpo-45711: Remove type and traceback from exc_info (GH-30122)Irit Katriel2021-12-171-2/+3
| | | | | | | | * Do not PUSH/POP traceback or type to the stack as part of exc_info * Remove exc_traceback and exc_type from _PyErr_StackItem * Add to what's new, because this change breaks things like Cython
* bpo-46039: Split yield from in two (GH-30035)Mark Shannon2021-12-151-1/+2
| | | | | | * Split YIELD_FROM opcode into SEND and JUMP_ABSOLUTE. * Remove YIELD_FROM opcode.
* bpo-44525: Split calls into PRECALL and CALL (GH-30011)Mark Shannon2021-12-141-1/+2
| | | | | | | | | | * Add 3 new opcodes for calls: PRECALL_METHOD, CALL_NO_KW, CALL_KW. * Update specialization to handle new CALL opcodes. * Specialize call to method descriptors. * Remove old CALL opcodes: CALL_FUNCTION, CALL_METHOD, CALL_METHOD_KW, CALL_FUNCTION_KW.
* bpo-45292: [PEP-654] add except* (GH-29581)Irit Katriel2021-12-141-1/+2
|
* bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_ca… ↵Miro Hrončok2021-11-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-29384) Consider the following directory structure: . └── PATH1 └── namespace └── sub1 └── __init__.py And both PATH1 and PATH2 in sys path: $ PYTHONPATH=PATH1:PATH2 python3.11 >>> import namespace >>> import namespace.sub1 >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> ... While this interpreter still runs, PATH2/namespace/sub2 is created: . ├── PATH1 │ └── namespace │ └── sub1 │ └── __init__.py └── PATH2 └── namespace └── sub2 └── __init__.py The newly created module cannot be imported: >>> ... >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> import namespace.sub2 Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'namespace.sub2' Calling importlib.invalidate_caches() now newly allows to import it: >>> import importlib >>> importlib.invalidate_caches() >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> import namespace.sub2 >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace', '.../PATH2/namespace']) This was not previously possible.
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-231-1/+2
| | | | | | | | | | | to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
* bpo-45711: Re-bump the magic number and update doc (GH-29528)Brandt Bucher2021-11-121-2/+5
|
* bpo-45636: Merge all numeric operators (GH-29482)Brandt Bucher2021-11-111-0/+1
|
* bpo-45711: remove unnecessary DUP_TOP and POP in exception handling (GH-29495)Irit Katriel2021-11-101-1/+1
|
* bpo-44511: Improve the bytecode for class and mapping patterns (GH-26922)Brandt Bucher2021-10-271-1/+3
| | | | | | | * Refactor mapping patterns and speed up class patterns. * Simplify MATCH_KEYS and MATCH_CLASS. * Add COPY opcode.
* bpo-35673: Add a public alias for namespace package __loader__ attribute ↵Barry Warsaw2021-10-201-3/+9
| | | | | | | | (#29049) Rename namespace package __loader__ class to be public. Make the old name, i.e. _NamespaceLoader, an alias for the public name, for backward compatibility.
* Bump MAGIC_NUMBER to reflect change in JUMP_ABSOLUTE semantics. (GH-28829)Mark Shannon2021-10-091-1/+2
|
* bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)Gabriele N. Tornetta2021-07-071-1/+2
|
* bpo-43950: Add code.co_positions (PEP 657) (GH-26955)Pablo Galindo2021-07-021-1/+2
| | | | | | | | | | | | | | | This PR is part of PEP 657 and augments the compiler to emit ending line numbers as well as starting and ending columns from the AST into compiled code objects. This allows bytecodes to be correlated to the exact source code ranges that generated them. This information is made available through the following public APIs: * The `co_positions` method on code objects. * The C API function `PyCode_Addr2Location`. Co-authored-by: Batuhan Taskaya <isidentical@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-44313: bump up magic (#26983)Batuhan Taskaya2021-07-011-1/+1
|
* bpo-44313: generate LOAD_ATTR/CALL_FUNCTION for top-level imported objects ↵Batuhan Taskaya2021-06-301-0/+1
| | | | (GH-26677)