[pypy-svn] r28885 - in pypy/dist/pypy: module/_stackless module/_stackless/test translator/cli/src translator/js/proxy
arigo at codespeak.net
arigo at codespeak.net
Fri Jun 16 16:29:12 CEST 2006
Author: arigo
Date: Fri Jun 16 16:29:11 2006
New Revision: 28885
Modified:
pypy/dist/pypy/module/_stackless/app_greenlet.py (props changed)
pypy/dist/pypy/module/_stackless/interp_greenlet.py (props changed)
pypy/dist/pypy/module/_stackless/test/slp_test_pickle.py (contents, props changed)
pypy/dist/pypy/module/_stackless/test/test_greenlet.py (props changed)
pypy/dist/pypy/module/_stackless/test/test_pickle.py (props changed)
pypy/dist/pypy/translator/cli/src/ (props changed)
pypy/dist/pypy/translator/js/proxy/__init__.py (props changed)
Log:
fixeol
Modified: pypy/dist/pypy/module/_stackless/test/slp_test_pickle.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/test/slp_test_pickle.py (original)
+++ pypy/dist/pypy/module/_stackless/test/slp_test_pickle.py Fri Jun 16 16:29:11 2006
@@ -1,35 +1,35 @@
-from pypy.conftest import gettestobjspace
-
-# app-level testing of coroutine pickling
-
-class AppTest_Pickle:
-
- def setup_class(cls):
- space = gettestobjspace(usemodules=('_stackless',))
- cls.space = space
-
- def test_simple_ish(self):
-
- output = []
- import _stackless
- def f(coro, n, x):
- if n == 0:
- coro.switch()
- return
- f(coro, n-1, 2*x)
- output.append(x)
-
- def example():
- main_coro = _stackless.coroutine.getcurrent()
- sub_coro = _stackless.coroutine()
- sub_coro.bind(f, main_coro, 5, 1)
- sub_coro.switch()
-
- import pickle
- pckl = pickle.dumps(sub_coro)
- new_coro = pickle.loads(pckl)
-
- new_coro.switch()
-
- example()
- assert output == [16, 8, 4, 2, 1]
+from pypy.conftest import gettestobjspace
+
+# app-level testing of coroutine pickling
+
+class AppTest_Pickle:
+
+ def setup_class(cls):
+ space = gettestobjspace(usemodules=('_stackless',))
+ cls.space = space
+
+ def test_simple_ish(self):
+
+ output = []
+ import _stackless
+ def f(coro, n, x):
+ if n == 0:
+ coro.switch()
+ return
+ f(coro, n-1, 2*x)
+ output.append(x)
+
+ def example():
+ main_coro = _stackless.coroutine.getcurrent()
+ sub_coro = _stackless.coroutine()
+ sub_coro.bind(f, main_coro, 5, 1)
+ sub_coro.switch()
+
+ import pickle
+ pckl = pickle.dumps(sub_coro)
+ new_coro = pickle.loads(pckl)
+
+ new_coro.switch()
+
+ example()
+ assert output == [16, 8, 4, 2, 1]
More information about the Pypy-commit
mailing list