mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
GH-96793: Implement PEP 479 in bytecode. (GH-99006)
* Handle converting StopIteration to RuntimeError in bytecode. * Add custom instruction for converting StopIteration into RuntimeError.
This commit is contained in:
parent
e9ac890c02
commit
f4adb97506
14 changed files with 220 additions and 96 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue