Add testcase with exception handler spread across functions.
This commit is contained in:
parent
3f759b71c6
commit
c92a56dc93
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue