From: Stefan Behnel Date: Thu, 26 Nov 2009 20:42:37 +0000 (+0100) Subject: extended test case X-Git-Tag: 0.12.1~118 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bc82e78e993283c98165cc6e9ed0a682250ed2d2;p=cython.git extended test case --- 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: