From: Robert Bradshaw Date: Thu, 26 Feb 2009 07:48:44 +0000 (-0800) Subject: Another test for try-break. X-Git-Tag: 0.11.rc~34 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1b3b70cefc45fd41c4c7a3c09313802aba6abd70;p=cython.git Another test for try-break. --- diff --git a/tests/run/trybreak.pyx b/tests/run/trybreak.pyx new file mode 100644 index 00000000..bc4c7155 --- /dev/null +++ b/tests/run/trybreak.pyx @@ -0,0 +1,17 @@ +__doc__ = u""" +>>> foo() +'a' +""" + +# Indirectly makes sure the cleanup happens correctly on breaking. +def foo(): + for x in "abc": + try: + x() + except: + break + for x in "abc": + try: + x() + except: + return x