[pypy-svn] r59438 - pypy/trunk/pypy/annotation

afa at codespeak.net afa at codespeak.net
Mon Oct 27 10:59:40 CET 2008


Author: afa
Date: Mon Oct 27 10:59:39 2008
New Revision: 59438

Modified:
   pypy/trunk/pypy/annotation/model.py
Log:
Another fix for python2.6: object.__new__ warns when parameters are passed.


Modified: pypy/trunk/pypy/annotation/model.py
==============================================================================
--- pypy/trunk/pypy/annotation/model.py	(original)
+++ pypy/trunk/pypy/annotation/model.py	Mon Oct 27 10:59:39 2008
@@ -113,7 +113,13 @@
     # for debugging, record where each instance comes from
     # this is disabled if DEBUG is set to False
     def __new__(cls, *args, **kw):
-        self = super(SomeObject, cls).__new__(cls, *args, **kw)
+        new = super(SomeObject, cls).__new__
+        if new is object.__new__:
+            # Since python 2.6, object.__new__ warns
+            # when parameters are passed
+            self = new(cls)
+        else:
+            self = new(cls, *args, **kw)
         if DEBUG:
             try:
                 bookkeeper = pypy.annotation.bookkeeper.getbookkeeper()



More information about the Pypy-commit mailing list