summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/try_finally_return.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/try_finally_return.py b/tests/basics/try_finally_return.py
index 31a507e8d..21e01ea21 100644
--- a/tests/basics/try_finally_return.py
+++ b/tests/basics/try_finally_return.py
@@ -70,3 +70,13 @@ def f():
finally:
print('finally 1')
print(f())
+
+# the finally block uses a lot of Python stack and then a local is accessed
+# (tests that the use of the stack doesn't clobber the local)
+def f(x):
+ try:
+ return x
+ finally:
+ print(2, 3, 4, 5, 6)
+ print(x)
+print(f(1))