Skip to content

Commit

Permalink
Bump MAGIC_NUMBER to reflect change in JUMP_ABSOLUTE semantics. (GH-2…
Browse files Browse the repository at this point in the history
  • Loading branch information
markshannon committed Oct 9, 2021
1 parent 9fa930d commit 5e173f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/importlib/_bootstrap_external.py
Expand Up @@ -363,6 +363,7 @@ def _write_atomic(path, data, mode=0o666):
# Python 3.11a1 3458 (imported objects now don't use LOAD_METHOD/CALL_METHOD)
# Python 3.11a1 3459 (PEP 657: add end line numbers and column offsets for instructions)
# Python 3.11a1 3460 (Add co_qualname field to PyCodeObject bpo-44530)
# Python 3.11a1 3461 (JUMP_ABSOLUTE must jump backwards)

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

MAGIC_NUMBER = (3460).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3461).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c

_PYCACHE = '__pycache__'
Expand Down

0 comments on commit 5e173f5

Please sign in to comment.