diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-01 00:55:05 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-01 15:23:03 +0200 |
commit | 6472dea1468e895c21aad98f75e85c67e43f716e (patch) | |
tree | 908506419f993fd901d2f06304bd03ba24cabae2 /tests/basics | |
parent | 532f2c30f66c9ff1e4f2aded29b98ba0db5ec341 (diff) | |
download | micropython-6472dea1468e895c21aad98f75e85c67e43f716e.tar.gz micropython-6472dea1468e895c21aad98f75e85c67e43f716e.zip |
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.
Diffstat (limited to 'tests/basics')
-rw-r--r-- | tests/basics/try-finally-return.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/basics/try-finally-return.py b/tests/basics/try-finally-return.py new file mode 100644 index 0000000000..053fd4b134 --- /dev/null +++ b/tests/basics/try-finally-return.py @@ -0,0 +1,7 @@ +def func1(): + try: + return "it worked" + finally: + print("finally 1") + +print(func1()) |