You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
382e8eeea2
Allows to have nested try blocks with except filters. TODO: Don't add END_FINALLY's exception re-raise points to traceback.
24 lines
333 B
Python
24 lines
333 B
Python
# nested try's
|
|
|
|
try:
|
|
print("try 1")
|
|
try:
|
|
print("try 2")
|
|
foo()
|
|
except:
|
|
print("except 2")
|
|
bar()
|
|
except:
|
|
print("except 1")
|
|
|
|
try:
|
|
print("try 1")
|
|
try:
|
|
print("try 2")
|
|
foo()
|
|
except TypeError:
|
|
print("except 2")
|
|
bar()
|
|
except NameError:
|
|
print("except 1")
|