circuitpython/tests/basics/try-finally-return.py
Paul Sokolovsky 6472dea146 Add exception stack unwind support for RETURN_VALUE.
This properly implements return from try/finally block(s).

TODO: Consider if we need to do any value stack unwinding for RETURN_VALUE
case. Intuitively, this is "success" return, so value stack should be in
good shape, and unwinding shouldn't be required.
2014-02-01 15:23:03 +02:00

8 lines
105 B
Python

def func1():
try:
return "it worked"
finally:
print("finally 1")
print(func1())