aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-07-07 07:38:36 +0100
committerGitHub <noreply@github.com>2022-07-06 23:38:36 -0700
commitbde06e1b8381f140b296a397ddd1deb1c784ff8e (patch)
tree7ff63df7d55741dae98638e14e691f6ccdf5bf4d /Lib/test/test_sys_settrace.py
parent94988603f3c934f95220f09aefffd50c0a5d3367 (diff)
downloadcpython-bde06e1b8381f140b296a397ddd1deb1c784ff8e.tar.gz
cpython-bde06e1b8381f140b296a397ddd1deb1c784ff8e.zip
gh-92228: disable the compiler's 'small exit block inlining' optimization for blocks that have a line number (GH-94592)
Inlining of code that corresponds to source code lines, can make it hard to distinguish later between code which is only reachable from except handlers, and that which is reachable in normal control flow. This caused problems with the debugger's jump feature. This PR turns off the inlining optimisation for code which has line numbers. We still inline things like the implicit "return None".
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 7ec290dbf04..f03b03e19a2 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -2042,6 +2042,15 @@ class JumpTestCase(unittest.TestCase):
output.append(6)
output.append(7)
+ @jump_test(6, 1, [1, 5, 1, 5])
+ def test_jump_over_try_except(output):
+ output.append(1)
+ try:
+ 1 / 0
+ except ZeroDivisionError as e:
+ output.append(5)
+ x = 42 # has to be a two-instruction block
+
@jump_test(2, 4, [1, 4, 5, -4])
def test_jump_across_with(output):
output.append(1)