summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-12-21 13:53:50 (GMT)
committerGitHub <noreply@github.com>2020-12-21 13:53:50 (GMT)
commitf2dbfd7e20431f0bcf2b655aa876afec7fe03c6f (patch)
treef56aebc70e3cc671bb96cd19d3fc0adc7988769c /Lib/test/test_sys_settrace.py
parentd515c610c61b9a8c40c037a3dc3bfc8d67563658 (diff)
downloadcpython-f2dbfd7e20431f0bcf2b655aa876afec7fe03c6f.zip
cpython-f2dbfd7e20431f0bcf2b655aa876afec7fe03c6f.tar.gz
cpython-f2dbfd7e20431f0bcf2b655aa876afec7fe03c6f.tar.bz2
bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)
* Mark reraise after except blocks as artificial. * Update importlib * Update dis test.
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 3bfc993..340f37f 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -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"""