mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Don't generate spurious line number in try-except-finally. (#23760)
This commit is contained in:
parent
674fa0a740
commit
56aa20f9eb
4 changed files with 1752 additions and 1733 deletions
|
@ -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"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue