Don't generate spurious line number in try-except-finally. (#23760)

This commit is contained in:
Mark Shannon 2020-12-14 10:19:10 +00:00 committed by GitHub
parent 674fa0a740
commit 56aa20f9eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1752 additions and 1733 deletions

View file

@ -629,6 +629,23 @@ class TraceTestCase(unittest.TestCase):
(3, 'line'),
(3, 'return')])
def test_try_except_no_exception(self):
def func():
try:
2
except:
4
finally:
6
self.run_and_compare(func,
[(0, 'call'),
(1, 'line'),
(2, 'line'),
(6, 'line'),
(6, 'return')])
class SkipLineEventsTraceTestCase(TraceTestCase):
"""Repeat the trace tests, but with per-line events skipped"""