]> 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 02:20:08 +0000 (21:20 -0500)
committerR David Murray <rdmurray@bitdance.com>
Tue, 19 Feb 2013 02:20:08 +0000 (21:20 -0500)
Patch by Alexander Belopolsky.

Misc/NEWS
Objects/typeobject.c

index 51f6f1b78d64d5e77957ebd56b903dc7d74f1b3c..6f01693b2b1e5223d4b8041be0d121aba610b640 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.2.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 fd2ae67d860f598242c3c205470f2315c12886c8..bbf03a102f78af769cbe6a0aee5fe3db290a9123 100644 (file)
@@ -2842,14 +2842,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;
         }
     }