[pypy-commit] pypy unpickle-coroutine-trampoline: (arigo, cfbolz): fix the remaining failing test. Coroutines that end with an exception didn't work as they should. The fix is obvious, no?
cfbolz
noreply at buildbot.pypy.org
Fri May 13 18:38:34 CEST 2011
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: unpickle-coroutine-trampoline
Changeset: r44147:d50af6b7bebd
Date: 2011-05-13 18:38 +0200
http://bitbucket.org/pypy/pypy/changeset/d50af6b7bebd/
Log: (arigo, cfbolz): fix the remaining failing test. Coroutines that end
with an exception didn't work as they should. The fix is obvious,
no?
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
@@ -403,4 +403,6 @@
except OperationError, operr:
pass
frame = frame.f_backref()
+ if operr:
+ raise operr
return w_result
diff --git a/pypy/module/_stackless/test/test_pickle.py b/pypy/module/_stackless/test/test_pickle.py
--- a/pypy/module/_stackless/test/test_pickle.py
+++ b/pypy/module/_stackless/test/test_pickle.py
@@ -257,16 +257,26 @@
pckl = pickle.dumps(sub_coro)
new_coro = pickle.loads(pckl)
- new_coro.switch()
+ try:
+ sub_coro.switch()
+ except ValueError:
+ pass
+ else:
+ assert 0
+ try:
+ new_coro.switch()
+ except ValueError:
+ pass
+ else:
+ assert 0
example()
-assert output == [16, 8, 4, 2, 1]
+assert output == [16, 8, 4, 2, 1] * 2
''' in mod.__dict__
finally:
del sys.modules['mod']
def test_loop(self):
- #skip("happily segfaulting")
import new, sys
mod = new.module('mod')
@@ -375,7 +385,6 @@
def test_solver(self):
- skip("fix me please")
import new, sys
mod = new.module('mod')
More information about the pypy-commit
mailing list