summaryrefslogtreecommitdiff
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
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 3bfc99385d..340f37fae7 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"""