Skip to content

Commit 8f1b71d

Browse files
authored
bpo-45711: Re-bump the magic number and update doc (GH-29528)
1 parent e501d70 commit 8f1b71d

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Doc/library/dis.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,10 +873,13 @@ All of the following opcodes use their arguments.
873873
.. opcode:: JUMP_IF_NOT_EXC_MATCH (target)
874874

875875
Tests whether the second value on the stack is an exception matching TOS,
876-
and jumps if it is not. Pops two values from the stack.
876+
and jumps if it is not. Pops one value from the stack.
877877

878878
.. versionadded:: 3.9
879879

880+
.. versionchanged:: 3.11
881+
This opcode no longer pops the active exception.
882+
880883

881884
.. opcode:: JUMP_IF_TRUE_OR_POP (target)
882885

Doc/whatsnew/3.11.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ CPython bytecode changes
332332
* Added :opcode:`COPY`, which pushes the *i*-th item to the top of the stack.
333333
The item is not removed from its original location.
334334

335+
* :opcode:`JUMP_IF_NOT_EXC_MATCH` no longer pops the active exception.
336+
335337

336338
Deprecated
337339
==========

Lib/importlib/_bootstrap_external.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,10 @@ def _write_atomic(path, data, mode=0o666):
366366
# Python 3.11a1 3461 (JUMP_ABSOLUTE must jump backwards)
367367
# Python 3.11a2 3462 (bpo-44511: remove COPY_DICT_WITHOUT_KEYS, change
368368
# MATCH_CLASS and MATCH_KEYS, and add COPY)
369-
# Python 3.11a3 3463 (Merge numeric BINARY_*/INPLACE_* into BINARY_OP)
369+
# Python 3.11a3 3463 (bpo-45711: JUMP_IF_NOT_EXC_MATCH no longer pops the
370+
# active exception)
371+
# Python 3.11a3 3464 (bpo-45636: Merge numeric BINARY_*/INPLACE_* into
372+
# BINARY_OP)
370373

371374
#
372375
# MAGIC must change whenever the bytecode emitted by the compiler may no
@@ -376,7 +379,7 @@ def _write_atomic(path, data, mode=0o666):
376379
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
377380
# in PC/launcher.c must also be updated.
378381

379-
MAGIC_NUMBER = (3463).to_bytes(2, 'little') + b'\r\n'
382+
MAGIC_NUMBER = (3464).to_bytes(2, 'little') + b'\r\n'
380383
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
381384

382385
_PYCACHE = '__pycache__'

0 commit comments

Comments
 (0)