mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
#7963: fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
This commit is contained in:
parent
1548ed6698
commit
6b30759022
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue