[pypy-svn] r40110 - in pypy/dist/pypy/objspace: . std
pedronis at codespeak.net
pedronis at codespeak.net
Fri Mar 9 15:00:31 CET 2007
Author: pedronis
Date: Fri Mar 9 15:00:27 2007
New Revision: 40110
Modified:
pypy/dist/pypy/objspace/std/objecttype.py
pypy/dist/pypy/objspace/std/typeobject.py
pypy/dist/pypy/objspace/std/typetype.py
pypy/dist/pypy/objspace/taint.py
Log:
Fix taint translation. Don't have methods demoted to W_Root.
One more XXX, add some details to another one.
Modified: pypy/dist/pypy/objspace/std/objecttype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/objecttype.py (original)
+++ pypy/dist/pypy/objspace/std/objecttype.py Fri Mar 9 15:00:27 2007
@@ -28,6 +28,8 @@
raise OperationError(space.w_TypeError,
space.wrap("__class__ assignment: only for heap types"))
w_oldcls = space.type(w_obj)
+ # XXX taint space should raise a TaintError here if w_oldcls is tainted
+ assert isinstance(w_oldcls, W_TypeObject)
if w_oldcls.get_full_instance_layout() == w_newcls.get_full_instance_layout():
w_obj.setclass(space, w_newcls)
else:
Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py (original)
+++ pypy/dist/pypy/objspace/std/typeobject.py Fri Mar 9 15:00:27 2007
@@ -204,7 +204,7 @@
if space.config.objspace.std.withtypeversion:
w_self.version_tag = None
w_self.mro_w = []
- mro_func = w_type.lookup('mro')
+ mro_func = space.lookup(w_self, 'mro')
mro_func_args = Arguments(space, [w_self])
w_mro = space.call_args(mro_func, mro_func_args)
w_self.mro_w = space.unpackiterable(w_mro)
Modified: pypy/dist/pypy/objspace/std/typetype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typetype.py (original)
+++ pypy/dist/pypy/objspace/std/typetype.py Fri Mar 9 15:00:27 2007
@@ -106,7 +106,7 @@
def mro_internal(space, w_type):
if not space.is_w(space.type(w_type), space.w_type):
#w_type.mro_w = []
- mro_func = space.type(w_type).lookup('mro')
+ mro_func = space.lookup(w_type, 'mro')
mro_func_args = Arguments(space, [w_type])
w_mro = space.call_args(mro_func, mro_func_args)
w_type.mro_w = space.unpackiterable(w_mro)
Modified: pypy/dist/pypy/objspace/taint.py
==============================================================================
--- pypy/dist/pypy/objspace/taint.py (original)
+++ pypy/dist/pypy/objspace/taint.py Fri Mar 9 15:00:27 2007
@@ -205,7 +205,7 @@
self.wrap(app_taint_look))
patch_space_in_place(self, 'taint', proxymaker)
- # XXX may leak info, perfomance hit
+ # XXX may leak info, perfomance hit, what about taint bombs?
from pypy.objspace.std.typeobject import W_TypeObject
def taint_lookup(w_obj, name):
More information about the Pypy-commit
mailing list