[pypy-svn] r48291 - pypy/dist/pypy/rpython

fijal at codespeak.net fijal at codespeak.net
Sun Nov 4 16:12:36 CET 2007


Author: fijal
Date: Sun Nov  4 16:12:34 2007
New Revision: 48291

Modified:
   pypy/dist/pypy/rpython/rpbc.py
Log:
Be on the safe side. Attribute when non-existant is not needed on the result
desc, but should not generate a warning anyway.


Modified: pypy/dist/pypy/rpython/rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/rpbc.py	(original)
+++ pypy/dist/pypy/rpython/rpbc.py	Sun Nov  4 16:12:34 2007
@@ -481,9 +481,12 @@
                 if r_value.lowleveltype is Void:
                     continue
                 try:
-                    thisattrvalue = frozendesc.read_attribute(attr)
-                except AttributeError:
-                    warning("Desc %r has no attribute %r" % (frozendesc, attr))
+                    thisattrvalue = frozendesc.attrcache[attr]
+                except KeyError:
+                    # don't issue warning if this attribute can be read, but
+                    # is not used
+                    if not getattr(frozendesc.pyobj, attr, None):
+                        warning("Desc %r has no attribute %r" % (frozendesc, attr))
                     continue
                 llvalue = r_value.convert_const(thisattrvalue)
                 setattr(result, mangled_name, llvalue)



More information about the Pypy-commit mailing list