Author: Carl Friedrich Bolz <cfb...@gmx.de>
Branch: unpickle-coroutine-trampoline
Changeset: r44094:8d0c3802413e
Date: 2011-05-12 12:48 +0200
http://bitbucket.org/pypy/pypy/changeset/8d0c3802413e/

Log:    fix unpickling of unbound coroutines

diff --git a/pypy/module/_stackless/interp_coroutine.py 
b/pypy/module/_stackless/interp_coroutine.py
--- a/pypy/module/_stackless/interp_coroutine.py
+++ b/pypy/module/_stackless/interp_coroutine.py
@@ -232,7 +232,10 @@
         ec = self.space.getexecutioncontext()
         self.subctx.setstate(space, w_state)
         if space.is_w(w_thunk, space.w_None):
-            self.bind(_ResumeThunk(space, self.costate, self.subctx.topframe))
+            if space.is_w(w_state, space.w_None):
+                self.thunk = None
+            else:
+                self.bind(_ResumeThunk(space, self.costate, 
self.subctx.topframe))
         else:
             w_func, w_args, w_kwds = space.unpackiterable(w_thunk,
                                                           expected_length=3)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to