summaryrefslogtreecommitdiff
path: root/Lib/importlib
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-12-17 13:55:28 +0000
committerGitHub <noreply@github.com>2020-12-17 13:55:28 +0000
commitbf353f3c2d937772a8cf30b15fd8eb7b82665ccb (patch)
tree9196732769c1cca2bd01a44e668fe4c5fb29f7d7 /Lib/importlib
parent40125ab3252453bf205ed906e46bf9741c27bf9d (diff)
downloadcpython-git-bf353f3c2d937772a8cf30b15fd8eb7b82665ccb.tar.gz
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.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap_external.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index d9e44df409..354650011e 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -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__'