pocketpy/tests/_exception.py
blueloveTH 730201907c up
2023-02-04 17:46:50 +08:00

16 lines
244 B
Python

try:
raise KeyError
except:
print("exception caught")
print(123)
def f():
try:
raise KeyError('foo')
except A: # will fail to catch
print("xx")
except:
print("exception caught")
print(123)
f()