Skip to content

Commit 135a499

Browse files
committed
Catch up with main
2 parents 6e6a3b4 + b88d9e7 commit 135a499

31 files changed

+625
-340
lines changed

Doc/library/zipapp.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,7 @@ The steps to create a standalone archive are as follows:
281281
file - if not, you can just list the dependencies manually on the pip command
282282
line).
283283

284-
3. Optionally, delete the ``.dist-info`` directories created by pip in the
285-
``myapp`` directory. These hold metadata for pip to manage the packages, and
286-
as you won't be making any further use of pip they aren't required -
287-
although it won't do any harm if you leave them.
288-
289-
4. Package the application using:
284+
3. Package the application using:
290285

291286
.. code-block:: shell-session
292287

Doc/whatsnew/3.12.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ Inlining does result in a few visible behavior changes:
257257

258258
* There is no longer a separate frame for the comprehension in tracebacks,
259259
and tracing/profiling no longer shows the comprehension as a function call.
260+
* The :mod:`symtable` module will no longer produce child symbol tables for each
261+
comprehension; instead, the comprehension's locals will be included in the
262+
parent function's symbol table.
260263
* Calling :func:`locals` inside a comprehension now includes variables
261264
from outside the comprehension, and no longer includes the synthetic ``.0``
262265
variable for the comprehension "argument".

Include/internal/pycore_instruments.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# error "this header requires Py_BUILD_CORE define"
66
#endif
77

8-
#include "pycore_bitutils.h" // _Py_popcount32
98
#include "pycore_frame.h" // _PyInterpreterFrame
109

1110
#ifdef __cplusplus

Include/internal/pycore_opcode_metadata.h

Lines changed: 48 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/importlib/_bootstrap_external.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,9 @@ def _write_atomic(path, data, mode=0o666):
455455
# Python 3.13a1 3557 (Make the conversion to boolean in jumps explicit)
456456
# Python 3.13a1 3558 (Reorder the stack items for CALL)
457457
# Python 3.13a1 3559 (Generate opcode IDs from bytecodes.c)
458-
# Python 3.13a1 3560 (Add CALL_KW and remove KW_NAMES)
459-
# Python 3.13a1 3561 (Add RESUME_CHECK instruction)
458+
# Python 3.13a1 3560 (Add RESUME_CHECK instruction)
459+
# Python 3.13a1 3561 (Add cache entry to branch instructions)
460+
# Python 3.13a1 3562 (Add CALL_KW and remove KW_NAMES)
460461

461462
# Python 3.14 will start with 3600
462463

@@ -473,7 +474,7 @@ def _write_atomic(path, data, mode=0o666):
473474
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
474475
# in PC/launcher.c must also be updated.
475476

476-
MAGIC_NUMBER = (3561).to_bytes(2, 'little') + b'\r\n'
477+
MAGIC_NUMBER = (3562).to_bytes(2, 'little') + b'\r\n'
477478

478479
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
479480

Lib/opcode.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@
9393
"counter": 1,
9494
"version": 2,
9595
},
96+
"POP_JUMP_IF_TRUE": {
97+
"counter": 1,
98+
},
99+
"POP_JUMP_IF_FALSE": {
100+
"counter": 1,
101+
},
102+
"POP_JUMP_IF_NONE": {
103+
"counter": 1,
104+
},
105+
"POP_JUMP_IF_NOT_NONE": {
106+
"counter": 1,
107+
},
96108
}
97109

98110
_inline_cache_entries = {

Lib/test/support/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"LOOPBACK_TIMEOUT", "INTERNET_TIMEOUT", "SHORT_TIMEOUT", "LONG_TIMEOUT",
6363
"Py_DEBUG", "EXCEEDS_RECURSION_LIMIT", "Py_C_RECURSION_LIMIT",
6464
"skip_on_s390x",
65+
"without_optimizer",
6566
]
6667

6768

@@ -2533,3 +2534,19 @@ def adjust_int_max_str_digits(max_digits):
25332534
'skipped on s390x')
25342535

25352536
Py_TRACE_REFS = hasattr(sys, 'getobjects')
2537+
2538+
# Decorator to disable optimizer while a function run
2539+
def without_optimizer(func):
2540+
try:
2541+
import _testinternalcapi
2542+
except ImportError:
2543+
return func
2544+
@functools.wraps(func)
2545+
def wrapper(*args, **kwargs):
2546+
save_opt = _testinternalcapi.get_optimizer()
2547+
try:
2548+
_testinternalcapi.set_optimizer(None)
2549+
return func(*args, **kwargs)
2550+
finally:
2551+
_testinternalcapi.set_optimizer(save_opt)
2552+
return wrapper

0 commit comments

Comments
 (0)