Author: Armin Rigo <[email protected]>
Branch: stacklet
Changeset: r46589:a2baafd784b2
Date: 2011-08-17 22:12 +0200
http://bitbucket.org/pypy/pypy/changeset/a2baafd784b2/

Log:    Tweaks.

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
@@ -146,9 +146,15 @@
     try:
         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
         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 continuation"))
+
         args = args.prepend(space.wrap(self))
         w_result = space.call_args(w_callable, args)
     except Exception, e:
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
@@ -113,7 +113,7 @@
         assert res == 'ok'
         #
         c = continuation(empty_callback)
-        raises(TypeError, c.switch, 'foo')
+        raises(TypeError, c.switch, 'foo')  # "can't send non-None value"
 
     def test_continuation_error(self):
         from _continuation import continuation, error
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to