bpo-45711: Re-bump the magic number and update doc (GH-29528) · python/cpython@8f1b71d (original) (raw)

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -873,10 +873,13 @@ All of the following opcodes use their arguments.
873 873 .. opcode:: JUMP_IF_NOT_EXC_MATCH (target)
874 874
875 875 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.
877 877
878 878 .. versionadded:: 3.9
879 879
880 + .. versionchanged:: 3.11
881 + This opcode no longer pops the active exception.
882 +
880 883
881 884 .. opcode:: JUMP_IF_TRUE_OR_POP (target)
882 885
Original file line number Diff line number Diff line change
@@ -332,6 +332,8 @@ CPython bytecode changes
332 332 * Added :opcode:`COPY`, which pushes the *i*-th item to the top of the stack.
333 333 The item is not removed from its original location.
334 334
335 +* :opcode:`JUMP_IF_NOT_EXC_MATCH` no longer pops the active exception.
336 +
335 337
336 338 Deprecated
337 339 ==========
Original file line number Diff line number Diff line change
@@ -366,7 +366,10 @@ def _write_atomic(path, data, mode=0o666):
366 366 # Python 3.11a1 3461 (JUMP_ABSOLUTE must jump backwards)
367 367 # Python 3.11a2 3462 (bpo-44511: remove COPY_DICT_WITHOUT_KEYS, change
368 368 # 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)
370 373
371 374 #
372 375 # MAGIC must change whenever the bytecode emitted by the compiler may no
@@ -376,7 +379,7 @@ def _write_atomic(path, data, mode=0o666):
376 379 # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
377 380 # in PC/launcher.c must also be updated.
378 381
379 -MAGIC_NUMBER = (3463).to_bytes(2, 'little') + b'\r\n'
382 +MAGIC_NUMBER = (3464).to_bytes(2, 'little') + b'\r\n'
380 383 _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
381 384
382 385 _PYCACHE = '__pycache__'