summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-01-06 13:09:25 (GMT)
committerGitHub <noreply@github.com>2022-01-06 13:09:25 (GMT)
commite028ae99ecee671c0e8a3eabb829b5b2acfc4441 (patch)
tree497e68f1caeb92104bf3a464977bb0e024131f69 /Lib/importlib
parent3e43fac2503afe219336742b150b3ef6e470686f (diff)
downloadcpython-e028ae99ecee671c0e8a3eabb829b5b2acfc4441.zip
cpython-e028ae99ecee671c0e8a3eabb829b5b2acfc4441.tar.gz
cpython-e028ae99ecee671c0e8a3eabb829b5b2acfc4441.tar.bz2
bpo-45923: Handle call events in bytecode (GH-30364)
* Add a RESUME instruction to handle "call" events.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap_external.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 8e21be5..5aea0c4 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -379,16 +379,21 @@ _code_type = type(_write_atomic.__code__)
# Python 3.11a4 3471 (bpo-46202: remove pop POP_EXCEPT_AND_RERAISE)
# Python 3.11a4 3472 (bpo-46009: replace GEN_START with POP_TOP)
# Python 3.11a4 3473 (Add POP_JUMP_IF_NOT_NONE/POP_JUMP_IF_NONE opcodes)
+# Python 3.11a4 3474 (Add RESUME opcode)
+
+# Python 3.12 will start with magic number 3500
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
# due to the addition of new opcodes).
#
+# Starting with Python 3.11, Python 3.n starts with magic number 2900+50n.
+#
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
-MAGIC_NUMBER = (3473).to_bytes(2, 'little') + b'\r\n'
+MAGIC_NUMBER = (3474).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'