mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-42246: Make sure that f_lasti
, and thus f_lineno
, is set correctly after raising or reraising an exception (GH-23803)
* Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626. * Update importlib * Add NEWS.
This commit is contained in:
parent
40125ab325
commit
bf353f3c2d
13 changed files with 317 additions and 225 deletions
|
@ -312,6 +312,7 @@ _code_type = type(_write_atomic.__code__)
|
|||
# Python 3.10a1 3430 (Make 'annotations' future by default)
|
||||
# Python 3.10a1 3431 (New line number table format -- PEP 626)
|
||||
# Python 3.10a2 3432 (Function annotation for MAKE_FUNCTION is changed from dict to tuple bpo-42202)
|
||||
# Python 3.10a2 3433 (RERAISE restores f_lasti if oparg != 0)
|
||||
|
||||
#
|
||||
# MAGIC must change whenever the bytecode emitted by the compiler may no
|
||||
|
@ -321,7 +322,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 = (3432).to_bytes(2, 'little') + b'\r\n'
|
||||
MAGIC_NUMBER = (3433).to_bytes(2, 'little') + b'\r\n'
|
||||
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
|
||||
|
||||
_PYCACHE = '__pycache__'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue