try-break test
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 21 Feb 2009 05:26:46 +0000 (21:26 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 21 Feb 2009 05:26:46 +0000 (21:26 -0800)
tests/run/tryfinally.pyx

index 37a67bd6ea639ff09e8d3b476e3faebecb4abf9b..4f7aaa5ab239f48b89fdb4b5bf1fe5cbe3d3d7ad 100644 (file)
@@ -31,6 +31,7 @@ TypeError
 3
 >>> try_return_none_1()
 >>> try_return_none_2()
+>>> try_break()
 """
 
 def finally_except():
@@ -83,3 +84,11 @@ def try_return_none_2():
         return <object> _none()
     finally:
         return <object> _none()
+
+def try_break():
+    for a in "abcd":
+        try:
+            if a == 'c':
+                break
+        except:
+            break