diff options
author | Mark Shannon <mark@hotpy.org> | 2021-05-13 13:11:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-13 13:11:41 (GMT) |
commit | 0acdf255a51b836c0b44f3676797620322974af3 (patch) | |
tree | ad0927988cd589b10696a0133815da196c5f45a9 /Lib/test/test_sys_settrace.py | |
parent | 2d972b8e7cb5347ddf83dfcee461f550b59f0736 (diff) | |
download | cpython-0acdf255a51b836c0b44f3676797620322974af3.zip cpython-0acdf255a51b836c0b44f3676797620322974af3.tar.gz cpython-0acdf255a51b836c0b44f3676797620322974af3.tar.bz2 |
[3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26061)
* Guarantee that line number is set for returns.
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r-- | Lib/test/test_sys_settrace.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index 40dd92c..3296ee0 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -976,6 +976,26 @@ class TraceTestCase(unittest.TestCase): (3, 'return'), (1, 'return')]) + def test_try_in_try(self): + def func(): + try: + try: + pass + except Exception as ex: + pass + except Exception: + pass + + # This doesn't conform to PEP 626 + self.run_and_compare(func, + [(0, 'call'), + (1, 'line'), + (2, 'line'), + (3, 'line'), + (5, 'line'), + (5, 'return')]) + + class SkipLineEventsTraceTestCase(TraceTestCase): """Repeat the trace tests, but with per-line events skipped""" @@ -1647,6 +1667,7 @@ class JumpTestCase(unittest.TestCase): output.append(1) async for i in asynciter([1, 2]): output.append(3) + pass @jump_test(3, 2, [2, 2], (ValueError, 'into')) def test_no_jump_backwards_into_for_block(output): |