diff options
-rw-r--r-- | Python/ceval.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index ff5ee50..0178f84 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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); |