Skip to content

Commit c92a56d

Browse files
committed
Add testcase with exception handler spread across functions.
1 parent 3f759b7 commit c92a56d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/basics/try2.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,20 @@
2121
bar()
2222
except NameError:
2323
print("except 1")
24+
25+
# Check that exceptions across function boundaries work as expected
26+
def func1():
27+
try:
28+
print("try func1")
29+
func2()
30+
except NameError:
31+
print("except func1")
32+
33+
def func2():
34+
try:
35+
print("try func2")
36+
foo()
37+
except TypeError:
38+
print("except func2")
39+
40+
func1()

0 commit comments

Comments
 (0)