summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/try-finally-return.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/basics/try-finally-return.py b/tests/basics/try-finally-return.py
index 053fd4b134..4adf3f0977 100644
--- a/tests/basics/try-finally-return.py
+++ b/tests/basics/try-finally-return.py
@@ -5,3 +5,19 @@ def func1():
print("finally 1")
print(func1())
+
+
+def func2():
+ try:
+ return "it worked"
+ finally:
+ print("finally 2")
+
+def func3():
+ try:
+ s = func2()
+ return s + ", did this work?"
+ finally:
+ print("finally 3")
+
+print(func3())