Commit 2d1ad39b authored by Guido van Rossum's avatar Guido van Rossum

Add the type of the object to the error message about calling a non-function.

parent 6e73bf40
...@@ -2369,7 +2369,8 @@ call_builtin(func, arg, kw) ...@@ -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) ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment