[pypy-svn] r18891 - pypy/dist/pypy/objspace/std

pedronis at codespeak.net pedronis at codespeak.net
Mon Oct 24 21:18:18 CEST 2005


Author: pedronis
Date: Mon Oct 24 21:18:17 2005
New Revision: 18891

Modified:
   pypy/dist/pypy/objspace/std/model.py
Log:
make it more robust in the face of w__class__ attached more diffusely.



Modified: pypy/dist/pypy/objspace/std/model.py
==============================================================================
--- pypy/dist/pypy/objspace/std/model.py	(original)
+++ pypy/dist/pypy/objspace/std/model.py	Mon Oct 24 21:18:17 2005
@@ -131,7 +131,8 @@
            #', '.join(['%s=%r' % keyvalue for keyvalue in self.__dict__.items()])
             getattr(self, 'name', '')
             )
-        if hasattr(self, 'w__class__'):
+        w_cls = getattr(self, 'w__class__', None)
+        if w_cls is not None and w_cls is not self:
             s += ' instance of %s' % self.w__class__
         return '<%s>' % s
 



More information about the Pypy-commit mailing list