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

arigo at codespeak.net arigo at codespeak.net
Sun May 1 18:28:51 CEST 2005


Author: arigo
Date: Sun May  1 18:28:51 2005
New Revision: 11709

Modified:
   pypy/dist/pypy/objspace/std/test/test_typeobject.py
   pypy/dist/pypy/objspace/std/typeobject.py
Log:
Bug fix.


Modified: pypy/dist/pypy/objspace/std/test/test_typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_typeobject.py	Sun May  1 18:28:51 2005
@@ -279,4 +279,10 @@
         assert repr(A) == "<class 'a.A'>"
         assert repr(type(type)) == "<type 'type'>" 
         
-        
+    def test_invalid_mro(self):
+        class A(object):
+            pass
+        raises(TypeError, "class B(A, A): pass")
+        class C(A):
+            pass
+        raises(TypeError, "class D(A, C): pass")

Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Sun May  1 18:28:51 2005
@@ -350,7 +350,7 @@
     return GOODCANDIDATE # good candidate
 
 def _getname(space, w_cls):
-    return space.getattr(w_cls, space.wrap('__name__'))
+    return space.str_w(space.getattr(w_cls, space.wrap('__name__')))
 
 def mro_error(space, orderlists):
     cycle = []



More information about the Pypy-commit mailing list