[pypy-svn] r18075 - in pypy/dist/pypy/objspace/std: . test

arigo at codespeak.net arigo at codespeak.net
Sat Oct 1 21:52:27 CEST 2005


Author: arigo
Date: Sat Oct  1 21:52:22 2005
New Revision: 18075

Modified:
   pypy/dist/pypy/objspace/std/default.py
   pypy/dist/pypy/objspace/std/test/test_intobject.py
Log:
Use getname() here too.


Modified: pypy/dist/pypy/objspace/std/default.py
==============================================================================
--- pypy/dist/pypy/objspace/std/default.py	(original)
+++ pypy/dist/pypy/objspace/std/default.py	Sat Oct  1 21:52:22 2005
@@ -17,9 +17,8 @@
     pass
 
 def typed_unwrap_error_msg(space, expected, w_obj):
-    w = space.wrap
-    type_name = space.str_w(space.getattr(space.type(w_obj),w("__name__")))
-    return w("expected %s, got %s object" % (expected, type_name))
+    type_name = space.type(w_obj).getname(space, '?')
+    return space.wrap("expected %s, got %s object" % (expected, type_name))
 
 def int_w__ANY(space,w_obj):
     raise OperationError(space.w_TypeError,

Modified: pypy/dist/pypy/objspace/std/test/test_intobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_intobject.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_intobject.py	Sat Oct  1 21:52:22 2005
@@ -314,6 +314,7 @@
         assert 42 == int('2A', 16)
         assert 42 == int('42', 10)
         raises(TypeError, int, 1, 10)
+        raises(TypeError, int, '5', '9')
 
     def test_shift_zeros(self):
         assert (1 << 0) == 1



More information about the Pypy-commit mailing list