[pypy-commit] pypy stacklet: Test and fix.

arigo noreply at buildbot.pypy.org
Fri Aug 19 01:29:49 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: stacklet
Changeset: r46619:c30e2aaee6be
Date: 2011-08-18 22:50 +0200
http://bitbucket.org/pypy/pypy/changeset/c30e2aaee6be/

Log:	Test and fix.

diff --git a/pypy/module/_continuation/interp_continuation.py b/pypy/module/_continuation/interp_continuation.py
--- a/pypy/module/_continuation/interp_continuation.py
+++ b/pypy/module/_continuation/interp_continuation.py
@@ -194,10 +194,8 @@
         ec = self.sthread.ec
         ec.topframeref = jit.vref_None
 
-        # I think we can't have start_state.propagate_exception here for
-        # now, but in order to be future-proof...
         if start_state.propagate_exception is not None:
-            return self.h    # just propagate it further
+            raise start_state.propagate_exception   # just propagate it further
         if start_state.w_value is not space.w_None:
             raise OperationError(space.w_TypeError, space.wrap(
                 "can't send non-None value to a just-started continulet"))
diff --git a/pypy/module/_continuation/test/test_stacklet.py b/pypy/module/_continuation/test/test_stacklet.py
--- a/pypy/module/_continuation/test/test_stacklet.py
+++ b/pypy/module/_continuation/test/test_stacklet.py
@@ -567,6 +567,15 @@
         assert tb.tb_next.tb_next.tb_next.tb_frame.f_code.co_name == 'do_raise'
         assert tb.tb_next.tb_next.tb_next.tb_next is None
 
+    def test_throw_to_starting(self):
+        from _continuation import continulet
+        #
+        def f1(c1):
+            not_reached
+        #
+        c1 = continulet(f1)
+        raises(IndexError, c1.throw, IndexError)
+
     def test_various_depths(self):
         skip("may fail on top of CPython")
         # run it from test_translated, but not while being actually translated


More information about the pypy-commit mailing list