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

antocuni at codespeak.net antocuni at codespeak.net
Fri Jul 14 16:44:19 CEST 2006


Author: antocuni
Date: Fri Jul 14 16:44:15 2006
New Revision: 30041

Modified:
   pypy/dist/pypy/rpython/ootypesystem/ootype.py
Log:
Fix _null_mixin.__str__, because it can happen that _TYPE has no
_name. The List._name attribute is no longer necessary.



Modified: pypy/dist/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/ootype.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/ootype.py	Fri Jul 14 16:44:15 2006
@@ -361,7 +361,6 @@
 
     def __init__(self, ITEMTYPE=None):
         self._ITEMTYPE = ITEMTYPE
-        self._name = 'List<%s>' % ITEMTYPE
         self._null = _null_list(self)
         if ITEMTYPE is not None:
             self._init_methods()
@@ -665,7 +664,11 @@
     class mixin(object):
 
         def __str__(self):
-            return '%r null inst' % (self._TYPE._name,)
+            try:
+                name = self._TYPE._name
+            except AttributeError:
+                name = self._TYPE
+            return '%r null inst' % (name,)
 
         def __getattribute__(self, name):
             if name.startswith("_"):



More information about the Pypy-commit mailing list