[pypy-svn] r34903 - pypy/dist/pypy/objspace/std

mwh at codespeak.net mwh at codespeak.net
Thu Nov 23 15:57:44 CET 2006


Author: mwh
Date: Thu Nov 23 15:57:43 2006
New Revision: 34903

Modified:
   pypy/dist/pypy/objspace/std/typeobject.py
Log:
another test_descr bug: checking the return value of __init__()


Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Thu Nov 23 15:57:43 2006
@@ -375,7 +375,10 @@
     # maybe invoke the __init__ of the type
     if space.is_true(space.isinstance(w_newobject, w_type)):
         w_descr = space.lookup(w_newobject, '__init__')
-        space.get_and_call_args(w_descr, w_newobject, __args__)
+        w_result = space.get_and_call_args(w_descr, w_newobject, __args__)
+        if not space.is_w(w_result, space.w_None):
+            raise OperationError(space.w_TypeError,
+                                 space.wrap("__init__() should return None"))
     return w_newobject
 
 def issubtype__Type_Type(space, w_type1, w_type2):



More information about the Pypy-commit mailing list