From 1b3b70cefc45fd41c4c7a3c09313802aba6abd70 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 25 Feb 2009 23:48:44 -0800 Subject: [PATCH] Another test for try-break. --- tests/run/trybreak.pyx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/run/trybreak.pyx 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 -- 2.26.2