[Python-checkins] cpython (2.7): #7963: fix error message when 'object' called with arguments.
r.david.murray
python-checkins at python.org
Tue Feb 19 04:05:13 CET 2013
http://hg.python.org/cpython/rev/0082b7bf9501
changeset: 82262:0082b7bf9501
branch: 2.7
parent: 82255:3c5517c4fa5d
user: R David Murray <rdmurray at bitdance.com>
date: Mon Feb 18 22:04:59 2013 -0500
summary:
#7963: fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
files:
Misc/NEWS | 3 +++
Objects/typeobject.c | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -9,6 +9,9 @@
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
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2897,14 +2897,14 @@
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;
}
}
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list