summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
Commit message (Collapse)AuthorAgeFilesLines
* gh-93353: Fix importlib.resources._tempfile() finalizer (GH-93377)Miss Islington (bot)2022-06-131-2/+5
| | | | | | | | Fix the importlib.resources.as_file() context manager to remove the temporary file if destroyed late during Python finalization: keep a local reference to the os.remove() function. Patch by Victor Stinner. (cherry picked from commit 443ca731d6b1267fe2f92985e0490460c95e44a8) Co-authored-by: Victor Stinner <vstinner@python.org>
* 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-91298: Refine traversable (apply changes from importlib_resources 5.7.1) ↵Jason R. Coombs2022-04-172-15/+39
| | | | | | | (#91623) * bpo-47142: Refine traversable (apply changes from importlib_resources 5.7.1) * Replace changelog referencing github issue.
* 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-47004: Sync with importlib_metadata 4.11.3. (#31854)Jason R. Coombs2022-03-131-18/+39
|
* 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-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)Arie Bovenberg2022-02-111-0/+2
| | | | | | | Confirmed with @jaraco that this indeed needs a fix. A question that came up while I was digging into the code: I think `SelectableGroups` could similarly use `__slots__ = ()`, since its purpose seems only for convenience around `dict`, not to have attributes of its own. Automerge-Triggered-By: GH:jaraco
* 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-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata ↵Jason R. Coombs2022-01-231-2/+2
| | | | 4.10.1) (GH-30803)
* bpo-46474: Apply changes from importlib_metadata 4.10.0 (GH-30802)Jason R. Coombs2022-01-231-12/+0
|
* 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-46118: Move importlib.resources to its own package. (#30176)Jason R. Coombs2021-12-3111-367/+407
| | | | | * bpo-46118: Move importlib.resources to its own package. * Expand compatibility shims with documentation and explicit imports.
* bpo-46125: Refactor tests to test traversable API directly. Includes changes ↵Jason R. Coombs2021-12-194-24/+23
| | | | from importlib_resources 5.4.0. (GH-30189)
* 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-44893: Implement EntryPoint as simple class with attributes. (GH-30150)Jason R. Coombs2021-12-165-66/+176
| | | | | * bpo-44893: Implement EntryPoint as simple class and deprecate tuple access in favor of attribute access. Syncs with importlib_metadata 4.8.1. * Apply refactorings found in importlib_metadata 4.8.2.
* bpo-46105: Honor spec when generating requirement specs with urls and ↵Jason R. Coombs2021-12-161-2/+11
| | | | extras. (GH-30151)
* 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-45514: Deprecate importlib resources legacy functions. (GH-29036)Jason R. Coombs2021-11-242-2/+42
| | | | | | | | | | | * bpo-45514: Apply changes from importlib_resources@a3ef4128c6 * Mark legacy functions as deprecated in the docs and link to the migration docs in importlib_resources docs. * Apply changes from importlib_resources@329ae9d5f2c. * Indicate importlib.resources as a module. Co-authored-by: Filipe Laíns <lains@riseup.net>
* 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
|