From: R David Murray Date: Tue, 19 Feb 2013 02:20:08 +0000 (-0500) Subject: #7963: fix error message when 'object' called with arguments. X-Git-Tag: v3.2.4rc1~94 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b30759022d836099a0844983816edaa5e64f52f;p=python #7963: fix error message when 'object' called with arguments. Patch by Alexander Belopolsky. --- diff --git a/Misc/NEWS b/Misc/NEWS index 51f6f1b78d..6f01693b2b 100644 --- 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. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index fd2ae67d86..bbf03a102f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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; } }