mirror of https://github.com/python/cpython
Add the type of the object to the error message about calling a non-function.
This commit is contained in:
parent
6e73bf4032
commit
2d1ad39b81
|
@ -2369,7 +2369,8 @@ call_builtin(func, arg, kw)
|
||||||
Py_DECREF(call);
|
Py_DECREF(call);
|
||||||
return res;
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2438,8 +2439,9 @@ call_function(func, arg, kw)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!PyFunction_Check(func)) {
|
if (!PyFunction_Check(func)) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"call of non-function");
|
"call of non-function (type %s)",
|
||||||
|
func->ob_type->tp_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
Py_INCREF(arg);
|
Py_INCREF(arg);
|
||||||
|
|
Loading…
Reference in New Issue