bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)

* Mark reraise after except blocks as artificial.

* Update importlib

* Update dis test.
This commit is contained in:
Mark Shannon 2020-12-21 13:53:50 +00:00 committed by GitHub
parent d515c610c6
commit f2dbfd7e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 5067 additions and 5036 deletions

View file

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