[pypy-commit] lang-smalltalk default: patched getname, because in the newer images, not the class but an association is the last literal.

lwassermann noreply at buildbot.pypy.org
Wed Apr 3 13:48:51 CEST 2013


Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch: 
Changeset: r233:9545bbb0ad07
Date: 2013-03-25 18:20 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/9545bbb0ad07/

Log:	patched getname, because in the newer images, not the class but an
	association is the last literal.

diff --git a/spyvm/model.py b/spyvm/model.py
--- a/spyvm/model.py
+++ b/spyvm/model.py
@@ -758,7 +758,14 @@
 
     def get_identifier_string(self):
         try:
-            classname = self.literals[-1]._shadow.getname()
+            w_class = self.literals[-1]
+            if isinstance(w_class, W_PointersObject):
+                if w_class._shadow is None:
+                    classname = w_class._fetch(1)._shadow.getname()
+                else:
+                    classname = w_class._shadow.getname()
+            else:
+                classname = "<unknown>"
         except (IndexError, AttributeError):
             classname = "<unknown>"
         return "%s>>#%s" % (classname, self._likely_methodname)


More information about the pypy-commit mailing list