circuitpython/tests/micropython/native_try_deep.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
954 B
Python
Raw Normal View History

# test native try handling
2023-02-01 03:08:41 -05:00
# deeply nested try (9 deep)
@micropython.native
def f():
try:
try:
try:
try:
try:
try:
try:
try:
try:
raise ValueError
finally:
print(8)
finally:
print(7)
finally:
print(6)
finally:
print(5)
finally:
print(4)
finally:
print(3)
finally:
print(2)
finally:
print(1)
except ValueError:
2021-04-20 01:22:44 -04:00
print("ValueError")
f()