mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-30534: Fixed error messages when pass keyword arguments (#1901)
to functions implemented in C that don't support this. Also unified error messages for functions that don't take positional or keyword arguments.
This commit is contained in:
parent
5cefb6cfdd
commit
5eb788bf7f
5 changed files with 116 additions and 45 deletions
|
@ -1176,7 +1176,7 @@ wrapper_call(wrapperobject *wp, PyObject *args, PyObject *kwds)
|
|||
|
||||
if (kwds != NULL && (!PyDict_Check(kwds) || PyDict_GET_SIZE(kwds) != 0)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"wrapper %s doesn't take keyword arguments",
|
||||
"wrapper %s() takes no keyword arguments",
|
||||
wp->descr->d_base->name);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue