Add testcase with exception handler spread across functions.

This commit is contained in:
Paul Sokolovsky 2014-01-31 17:05:07 +02:00
parent 3f759b71c6
commit c92a56dc93
1 changed files with 17 additions and 0 deletions

View File

@ -21,3 +21,20 @@ try:
bar()
except NameError:
print("except 1")
# Check that exceptions across function boundaries work as expected
def func1():
try:
print("try func1")
func2()
except NameError:
print("except func1")
def func2():
try:
print("try func2")
foo()
except TypeError:
print("except func2")
func1()