[pypy-svn] r38477 - pypy/dist/pypy/lib

arigo at codespeak.net arigo at codespeak.net
Sun Feb 11 17:33:53 CET 2007


Author: arigo
Date: Sun Feb 11 17:33:52 2007
New Revision: 38477

Modified:
   pypy/dist/pypy/lib/_classobj.py
Log:
Complain if arguments are passed to the constructor of an old-style
class with no __init__.


Modified: pypy/dist/pypy/lib/_classobj.py
==============================================================================
--- pypy/dist/pypy/lib/_classobj.py	(original)
+++ pypy/dist/pypy/lib/_classobj.py	Sun Feb 11 17:33:52 2007
@@ -213,6 +213,8 @@
             ret = init(*args, **kwds)
             if ret is not None:
                 raise TypeError("__init__() should return None")
+        elif args or kwds:
+            raise TypeError("this constructor takes no arguments")
         return inst
 
 # capture _name, _bases slots for usage and then hide them!



More information about the Pypy-commit mailing list