Author: Ronan Lamy <[email protected]>
Branch: framestate
Changeset: r75854:7f1ca2ab5456
Date: 2015-02-13 12:51 +0000
http://bitbucket.org/pypy/pypy/changeset/7f1ca2ab5456/

Log:    Add failing test for the case where 'break' is hidden away inside a
        handler

diff --git a/rpython/flowspace/test/test_objspace.py 
b/rpython/flowspace/test/test_objspace.py
--- a/rpython/flowspace/test/test_objspace.py
+++ b/rpython/flowspace/test/test_objspace.py
@@ -206,6 +206,22 @@
     def test_break_continue(self):
         x = self.codetest(self.break_continue)
 
+    def test_break_from_handler(self):
+        def f(x):
+            while True:
+                try:
+                    x()
+                except TypeError:
+                    if x:
+                        raise
+                    break
+        assert f(0) is None
+        graph = self.codetest(f)
+        simplify_graph(graph)
+        entrymap = mkentrymap(graph)
+        links = entrymap[graph.returnblock]
+        assert len(links) == 1
+
     #__________________________________________________________
     def unpack_tuple(lst):
         a, b, c = lst
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to