[pypy-svn] r61385 - pypy/trunk/pypy/module/_lsprof

fijal at codespeak.net fijal at codespeak.net
Tue Jan 27 12:30:26 CET 2009


Author: fijal
Date: Tue Jan 27 12:30:23 2009
New Revision: 61385

Modified:
   pypy/trunk/pypy/module/_lsprof/interp_lsprof.py
Log:
be safer against broken classes that has no __name__ (or a broken one)


Modified: pypy/trunk/pypy/module/_lsprof/interp_lsprof.py
==============================================================================
--- pypy/trunk/pypy/module/_lsprof/interp_lsprof.py	(original)
+++ pypy/trunk/pypy/module/_lsprof/interp_lsprof.py	Tue Jan 27 12:30:23 2009
@@ -163,8 +163,7 @@
     if isinstance(w_arg, Method):
         w_function = w_arg.w_function
         w_class = w_arg.w_class
-        w_class_name = space.getattr(w_class, space.wrap('__name__'))
-        class_name = space.str_w(w_class_name)
+        class_name = space.str_w(space.str(w_class))
         assert isinstance(w_function, Function)
         return "{method '%s' of '%s' objects}" % (w_function.name, class_name)
     elif isinstance(w_arg, Function):



More information about the Pypy-commit mailing list