mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add the type of the object to the error message about calling a non-function.
This commit is contained in:
parent
6e73bf4032
commit
2d1ad39b81
1 changed files with 5 additions and 3 deletions
|
@ -2369,7 +2369,8 @@ call_builtin(func, arg, kw)
|
|||
Py_DECREF(call);
|
||||
return res;
|
||||
}
|
||||
PyErr_SetString(PyExc_TypeError, "call of non-function");
|
||||
PyErr_Format(PyExc_TypeError, "call of non-function (type %s)",
|
||||
func->ob_type->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2438,8 +2439,9 @@ call_function(func, arg, kw)
|
|||
}
|
||||
else {
|
||||
if (!PyFunction_Check(func)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"call of non-function");
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"call of non-function (type %s)",
|
||||
func->ob_type->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
Py_INCREF(arg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue