[pypy-svn] r65474 - pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp

antocuni at codespeak.net antocuni at codespeak.net
Thu May 28 11:12:43 CEST 2009


Author: antocuni
Date: Thu May 28 11:12:43 2009
New Revision: 65474

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py
Log:
enhance the repr of ootype.Class objects


Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/history.py	Thu May 28 11:12:43 2009
@@ -46,14 +46,15 @@
 
 def repr_object(box):
     try:
-        if box.value.obj._TYPE is ootype.String:
+        TYPE = box.value.obj._TYPE
+        if TYPE is ootype.String:
             return '(%r)' % box.value.obj._str
-        if isinstance(box.value.obj._TYPE, ootype.StaticMethod):
+        if TYPE is ootype.Class or isinstance(TYPE, ootype.StaticMethod):
             return '(%r)' % box.value.obj
         if isinstance(box.value.obj, ootype._view):
             return repr(box.value.obj._inst._TYPE)
         else:
-            return repr(box.value.obj._TYPE)
+            return repr(TYPE)
     except AttributeError:
         return box.value
 



More information about the Pypy-commit mailing list