mirror of
https://github.com/python/cpython
synced 2024-09-22 11:21:34 +00:00
#7963: fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
This commit is contained in:
parent
c8e75ba2c5
commit
5aff27aec1
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue