Skip to content

Commit 5c9a327

Browse files
committed
Update magic number for new bytecodes.
1 parent 1486559 commit 5c9a327

File tree

3 files changed

+120
-118
lines changed

3 files changed

+120
-118
lines changed

Lib/importlib/_bootstrap_external.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ def _write_atomic(path, data, mode=0o666):
274274
# Python 3.9a0 3420 (add LOAD_ASSERTION_ERROR #34880)
275275
# Python 3.9a0 3421 (simplified bytecode for with blocks #32949)
276276
# Python 3.9a0 3422 (remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY, POP_FINALLY bytecodes #33387)
277+
# Python 3.9a2 3423 (add IS_OP, CONTAINS_OP and JUMP_IF_NOT_EXC_MATCH bytecodes #39156)
277278
#
278279
# MAGIC must change whenever the bytecode emitted by the compiler may no
279280
# longer be understood by older implementations of the eval loop (usually
@@ -282,7 +283,7 @@ def _write_atomic(path, data, mode=0o666):
282283
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
283284
# in PC/launcher.c must also be updated.
284285

285-
MAGIC_NUMBER = (3422).to_bytes(2, 'little') + b'\r\n'
286+
MAGIC_NUMBER = (3423).to_bytes(2, 'little') + b'\r\n'
286287
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
287288

288289
_PYCACHE = '__pycache__'

PC/launcher.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,7 @@ static PYC_MAGIC magic_values[] = {
12471247
{ 3360, 3379, L"3.6" },
12481248
{ 3390, 3399, L"3.7" },
12491249
{ 3400, 3419, L"3.8" },
1250+
{ 3420, 3429, L"3.9" },
12501251
{ 0 }
12511252
};
12521253

@@ -1830,7 +1831,7 @@ process(int argc, wchar_t ** argv)
18301831

18311832
#if !defined(VENV_REDIRECT)
18321833
/* bpo-35811: The __PYVENV_LAUNCHER__ variable is used to
1833-
* override sys.executable and locate the original prefix path.
1834+
* override sys.executable and locate the original prefix path.
18341835
* However, if it is silently inherited by a non-venv Python
18351836
* process, that process will believe it is running in the venv
18361837
* still. This is the only place where *we* can clear it (that is,

0 commit comments

Comments
 (0)