[pypy-svn] r50725 - pypy/dist/pypy/objspace
cfbolz at codespeak.net
cfbolz at codespeak.net
Thu Jan 17 19:25:22 CET 2008
Author: cfbolz
Date: Thu Jan 17 19:25:20 2008
New Revision: 50725
Modified:
pypy/dist/pypy/objspace/reflective.py
Log:
running tests is good
Modified: pypy/dist/pypy/objspace/reflective.py
==============================================================================
--- pypy/dist/pypy/objspace/reflective.py (original)
+++ pypy/dist/pypy/objspace/reflective.py Thu Jan 17 19:25:20 2008
@@ -1,6 +1,7 @@
from pypy.interpreter import gateway
from pypy.interpreter.error import OperationError
from pypy.objspace import std
+from pypy.objspace.std.typeobject import W_TypeObject
from pypy.objspace.proxy import patch_space_in_place
def set_reflectivespace(space, w_reflectivespace):
@@ -44,14 +45,15 @@
if opname in DontWrapMe:
return None
def user_hook(*args_w):
+ w_rspace = get_reflective_space(space)
if w_rspace is not None:
try:
- w_f = space.getattr(w_rspace, space.wrap("newdict"))
+ w_f = space.getattr(w_rspace, space.wrap(opname))
except OperationError, e:
if not e.match(space, space.w_AttributeError):
raise
else:
- w_obj = space.call_function(w_f, w_obj)
+ w_obj = space.call_function(w_f, *args_w)
reset_reflective_space(space, w_rspace)
return w_obj
return None
@@ -59,7 +61,6 @@
if opname == "newdict": # grr grr kwargs
def fn(track_builtin_shadowing=False):
w_obj = parentfn(track_builtin_shadowing)
- w_rspace = get_reflective_space(space)
w_newobj = user_hook(w_obj)
if w_newobj is not None:
return w_newobj
@@ -67,7 +68,6 @@
elif opname.startswith("new"):
def fn(*args_w):
w_obj = parentfn(*args_w)
- w_rspace = get_reflective_space(space)
w_newobj = user_hook(w_obj)
if w_newobj is not None:
return w_newobj
More information about the Pypy-commit
mailing list