extended test case
authorStefan Behnel <scoder@users.berlios.de>
Thu, 26 Nov 2009 20:42:37 +0000 (21:42 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 26 Nov 2009 20:42:37 +0000 (21:42 +0100)
tests/run/tryfinally.pyx

index 4f7aaa5ab239f48b89fdb4b5bf1fe5cbe3d3d7ad..e7562d5bd4f20cd79f7ffba29f53f36d51fffbe2 100644 (file)
@@ -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: