mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 17:10:24 +08: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")
|