diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-01-13 12:34:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 12:34:38 +0000 |
commit | 9c2ebb906d1c68c3d571b100c92ceb08805b94cd (patch) | |
tree | 6952394ebf2354ea5fe8cfe5760158a332582f78 /Lib/test/test_sys_settrace.py | |
parent | 443b308fee088e21bbf472c376c5c9e3648f916c (diff) | |
download | cpython-9c2ebb906d1c68c3d571b100c92ceb08805b94cd.tar.gz cpython-9c2ebb906d1c68c3d571b100c92ceb08805b94cd.zip |
bpo-46344: Fix trace bug in else of try and try-star blocks (GH-30544)
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r-- | Lib/test/test_sys_settrace.py | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index 883b2842f2c..e5fc88e1b6f 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -644,16 +644,25 @@ class TraceTestCase(unittest.TestCase): 4 else: 6 + if False: + 8 + else: + 10 + if func.__name__ == 'Fred': + 12 finally: - 8 + 14 self.run_and_compare(func, [(0, 'call'), (1, 'line'), (2, 'line'), (6, 'line'), - (8, 'line'), - (8, 'return')]) + (7, 'line'), + (10, 'line'), + (11, 'line'), + (14, 'line'), + (14, 'return')]) def test_nested_loops(self): @@ -1222,16 +1231,25 @@ class TraceTestCase(unittest.TestCase): 4 else: 6 + if False: + 8 + else: + 10 + if func.__name__ == 'Fred': + 12 finally: - 8 + 14 self.run_and_compare(func, [(0, 'call'), (1, 'line'), (2, 'line'), (6, 'line'), - (8, 'line'), - (8, 'return')]) + (7, 'line'), + (10, 'line'), + (11, 'line'), + (14, 'line'), + (14, 'return')]) def test_try_except_star_named_no_exception(self): |