]> granicus.if.org Git - python/commitdiff
#7963: fix error message when 'object' called with arguments.
authorR David Murray <rdmurray@bitdance.com>
Tue, 19 Feb 2013 03:04:59 +0000 (22:04 -0500)
committerR David Murray <rdmurray@bitdance.com>
Tue, 19 Feb 2013 03:04:59 +0000 (22:04 -0500)
Patch by Alexander Belopolsky.

Misc/NEWS
Objects/typeobject.c

index ef3d053109cdcaacfa40505de6b6b486f9b42577..79e350a497e91a0ffd38cc2665e2fc4e4fabc72d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -9,6 +9,9 @@ What's New in Python 2.7.4
 Core and Builtins
 -----------------
 
+- Issue #7963: Fixed misleading error message that issued when object is
+  called without arguments.
+
 - Issue #5308: Raise ValueError when marshalling too large object (a sequence
   with size >= 2**31), instead of producing illegal marshal data.
 
index 0a79f8bef82d20d1c21068011de8df0939cfc6c0..518d6e8e05241d660ec8771c2e8dde6f5d56862a 100644 (file)
@@ -2897,14 +2897,14 @@ object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
             type->tp_init != object_init)
         {
             err = PyErr_WarnEx(PyExc_DeprecationWarning,
-                       "object.__new__() takes no parameters",
+                       "object() takes no parameters",
                        1);
         }
         else if (type->tp_new != object_new ||
                  type->tp_init == object_init)
         {
             PyErr_SetString(PyExc_TypeError,
-                "object.__new__() takes no parameters");
+                "object() takes no parameters");
             err = -1;
         }
     }