summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-08-25 18:16:54 (GMT)
committerGuido van Rossum <guido@python.org>1998-08-25 18:16:54 (GMT)
commit2d1ad39b8137e31c1ba80f85e264a0c450c7ef26 (patch)
tree28b6fe3a53c12aecc8cf0aab494b7ca86d7289c5 /Python
parent6e73bf403234be6fde0ad466208a9217f5f1ed95 (diff)
downloadcpython-2d1ad39b8137e31c1ba80f85e264a0c450c7ef26.zip
cpython-2d1ad39b8137e31c1ba80f85e264a0c450c7ef26.tar.gz
cpython-2d1ad39b8137e31c1ba80f85e264a0c450c7ef26.tar.bz2
Add the type of the object to the error message about calling a non-function.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c8
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);