diff options
author | Mark Shannon <mark@hotpy.org> | 2021-04-29 12:12:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 12:12:51 (GMT) |
commit | c76da79b37d2bcbe575cc927ba0a9b7a9ce465db (patch) | |
tree | cf5e884131b3f44f038355ff4980cfbb97a6e228 /Lib/importlib | |
parent | 53dd6c99b39d90935c00bc1558582e494641248e (diff) | |
download | cpython-c76da79b37d2bcbe575cc927ba0a9b7a9ce465db.zip cpython-c76da79b37d2bcbe575cc927ba0a9b7a9ce465db.tar.gz cpython-c76da79b37d2bcbe575cc927ba0a9b7a9ce465db.tar.bz2 |
bpo-42739: Don't use sentinels to mark end of line table. (GH-25657)
* Add length parameter to PyLineTable_InitAddressRange and doen't use sentinel values at end of table. Makes the line number table more robust.
* Update PyCodeAddressRange to match PEP 626.
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 6620b24..2b28187 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -350,6 +350,7 @@ _code_type = type(_write_atomic.__code__) # Python 3.10a7 3435 Use instruction offsets (as opposed to byte offsets). # Python 3.10b1 3436 (Add GEN_START bytecode #43683) # Python 3.10b1 3437 (Undo making 'annotations' future by default - We like to dance among core devs!) +# Python 3.10b1 3438 Safer line number table handling. # # MAGIC must change whenever the bytecode emitted by the compiler may no @@ -359,7 +360,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 = (3437).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3438).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' |