aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/importlib
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-11-03 04:38:51 -0700
committerGitHub <noreply@github.com>2022-11-03 11:38:51 +0000
commitf4adb975061874566766f7a67206cb7b0439bc11 (patch)
tree136b2e8b97fd8811cef1d2ff46d31fb61f26183a /Lib/importlib
parente9ac890c0273aee413aa528cc202c3efa29f1d7a (diff)
downloadcpython-f4adb975061874566766f7a67206cb7b0439bc11.tar.gz
cpython-f4adb975061874566766f7a67206cb7b0439bc11.zip
GH-96793: Implement PEP 479 in bytecode. (GH-99006)
* Handle converting StopIteration to RuntimeError in bytecode. * Add custom instruction for converting StopIteration into RuntimeError.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap_external.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 9c14f71b6c0..8cbc962cfa5 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -424,6 +424,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.12a1 3508 (Add CLEANUP_THROW)
# Python 3.12a1 3509 (Conditional jumps only jump forward)
# Python 3.12a1 3510 (FOR_ITER leaves iterator on the stack)
+# Python 3.12a1 3511 (Add STOPITERATION_ERROR instruction)
# Python 3.13 will start with 3550
@@ -436,7 +437,7 @@ _code_type = type(_write_atomic.__code__)
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
-MAGIC_NUMBER = (3510).to_bytes(2, 'little') + b'\r\n'
+MAGIC_NUMBER = (3511).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c