From b04dfbbe4bd7071d46c8688c2263726ea31d33cd Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Thu, 20 Jan 2022 11:46:39 +0000 Subject: bpo-46409: Make generators in bytecode (GH-30633) * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing. --- Lib/importlib/_bootstrap_external.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/importlib/_bootstrap_external.py') diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 5aea0c4f92..1560e60dbb 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -380,6 +380,7 @@ _code_type = type(_write_atomic.__code__) # 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.11a5 3475 (Add RETURN_GENERATOR opcode) # Python 3.12 will start with magic number 3500 @@ -393,7 +394,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 = (3474).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3475).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' -- cgit v1.2.1