[pypy-commit] pypy py3k: Fix tests for the Thunk Object Space
amauryfa
noreply at buildbot.pypy.org
Sat Jan 28 17:57:25 CET 2012
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r51916:8f7805107a60
Date: 2012-01-28 10:08 +0100
http://bitbucket.org/pypy/pypy/changeset/8f7805107a60/
Log: Fix tests for the Thunk Object Space
diff --git a/pypy/objspace/test/test_thunkobjspace.py b/pypy/objspace/test/test_thunkobjspace.py
--- a/pypy/objspace/test/test_thunkobjspace.py
+++ b/pypy/objspace/test/test_thunkobjspace.py
@@ -170,12 +170,12 @@
from __pypy__ import thunk
d = {}
# need the method to use the pypy compiler
- exec """if 1:
+ exec("""if 1:
def f(x):
return [x]
def g(l):
l.append(1)
- """ in d
+ """, d)
l = thunk(d['f'], 10)
d['g'](l)
assert l == [10, 1]
diff --git a/pypy/objspace/thunk.py b/pypy/objspace/thunk.py
--- a/pypy/objspace/thunk.py
+++ b/pypy/objspace/thunk.py
@@ -129,8 +129,7 @@
def lazy(space, w_callable):
"""Decorator to make a callable return its results wrapped in a thunk."""
- meth = Method(space, space.w_fn_thunk,
- w_callable, space.type(w_callable))
+ meth = Method(space, space.w_fn_thunk, w_callable)
return space.wrap(meth)
app_lazy = gateway.interp2app(lazy)
@@ -146,6 +145,7 @@
# ---- irregular operations ----
'wrap': 0,
'str_w': 1,
+ 'bytes_w': 1,
'int_w': 1,
'float_w': 1,
'uint_w': 1,
More information about the pypy-commit
mailing list