bpo-43693: Add _PyCode_New(). (gh-26375)

This is an internal-only API that helps us manage the many values used to create a code object.

https://bugs.python.org/issue43693
This commit is contained in:
Eric Snow 2021-05-27 09:54:34 -06:00 committed by GitHub
parent 318adeba78
commit 9f494d4929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 4736 additions and 4648 deletions

View file

@ -354,6 +354,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.10b1 3439 (Add ROT_N)
# Python 3.11a1 3450 Use exception table for unwinding ("zero cost" exception handling)
# Python 3.11a1 3451 (Add CALL_METHOD_KW)
# Python 3.11a1 3452 (drop nlocals from marshaled code objects)
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
@ -363,7 +364,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 = (3451).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3452).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'