From f2de9d60f7dbe91d9c92ebc8df3136403d9b7938 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 11 Sep 2018 15:33:25 +1000 Subject: py/emitnative: Fix try-finally in outer scope, so finally is cancelled. --- tests/basics/try_finally1.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/basics/try_finally1.py b/tests/basics/try_finally1.py index 1e821deb6..67ebe0b59 100644 --- a/tests/basics/try_finally1.py +++ b/tests/basics/try_finally1.py @@ -82,3 +82,15 @@ finally: print("except2") print("finally1") print() + +# case where exception is raised after a finally has finished (tests that the finally doesn't run again) +def func(): + try: + print("try") + finally: + print("finally") + foo +try: + func() +except: + print("except") -- cgit v1.2.3