[pypy-svn] r29734 - pypy/dist/pypy/rpython/ootypesystem

antocuni at codespeak.net antocuni at codespeak.net
Fri Jul 7 14:27:20 CEST 2006


Author: antocuni
Date: Fri Jul  7 14:27:18 2006
New Revision: 29734

Modified:
   pypy/dist/pypy/rpython/ootypesystem/rclass.py
Log:
(antocuni, pedronis)

Look at the classdesc when not finding an attribute of an instance, as
lltype does.



Modified: pypy/dist/pypy/rpython/ootypesystem/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rclass.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/rclass.py	Fri Jul  7 14:27:18 2006
@@ -455,10 +455,14 @@
                 try:
                     attrvalue = getattr(value, name)
                 except AttributeError:
-                    warning("prebuilt instance %r has no attribute %r" % (
-                        value, name))
-                    continue
-                llattrvalue = self.allfields[mangled].convert_const(attrvalue)
+                    attrvalue = self.classdef.classdesc.read_attribute(name, None)
+                    if attrvalue is None:
+                        warning("prebuilt instance %r has no attribute %r" % (
+                                value, name))
+                        continue
+                    llattrvalue = r.convert_desc_or_const(attrvalue)
+                else:
+                    llattrvalue = self.allfields[mangled].convert_const(attrvalue)
             setattr(result, mangled, llattrvalue)
 
 buildinstancerepr = InstanceRepr



More information about the Pypy-commit mailing list