mirror of
https://github.com/micropython/micropython.git
synced 2025-09-07 02:10:52 +02:00
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")
|