From bc82e78e993283c98165cc6e9ed0a682250ed2d2 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 26 Nov 2009 21:42:37 +0100 Subject: [PATCH] extended test case --- tests/run/tryfinally.pyx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/run/tryfinally.pyx b/tests/run/tryfinally.pyx index 4f7aaa5a..e7562d5b 100644 --- a/tests/run/tryfinally.pyx +++ b/tests/run/tryfinally.pyx @@ -9,6 +9,9 @@ TypeError Traceback (most recent call last): TypeError +>>> call_try_return_with_exception() +1 + >>> def try_return_py(): ... try: ... return 1 @@ -18,6 +21,8 @@ TypeError 2 >>> try_return_cy() 2 +>>> call_try_return_c() +2 >>> i=1 >>> for i in range(3): @@ -46,6 +51,24 @@ def try_return_cy(): finally: return 2 +cdef int try_return_c(): + try: + return 1 + finally: + return 2 + +def call_try_return_c(): + return try_return_c() + +cdef int try_return_with_exception(): + try: + raise TypeError + finally: + return 1 + +def call_try_return_with_exception(): + return try_return_with_exception() + def try_return_temp(a): b = a+2 try: -- 2.26.2