summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-06-16 00:09:28 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-06-16 00:09:28 (GMT)
commit239508cd1087a521ebe40fabc96c66dcb11c3f8c (patch)
treed0ab80fe1f3a673b65171bb0b4e76b758023a4ee /Python
parent57e52ef07613799632452ed599650aab642d783f (diff)
downloadcpython-239508cd1087a521ebe40fabc96c66dcb11c3f8c.zip
cpython-239508cd1087a521ebe40fabc96c66dcb11c3f8c.tar.gz
cpython-239508cd1087a521ebe40fabc96c66dcb11c3f8c.tar.bz2
SF bug 433228: repr(list) woes when len(list) big
call_object: If the object isn't callable, display its type in the error msg rather than its repr. Bugfix candidate.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ceecdb1..7f668fc 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2862,8 +2862,9 @@ call_object(PyObject *func, PyObject *arg, PyObject *kw)
else if ((call = func->ob_type->tp_call) != NULL)
result = (*call)(func, arg, kw);
else {
- PyErr_Format(PyExc_TypeError, "object is not callable: %s",
- PyString_AS_STRING(PyObject_Repr(func)));
+ PyErr_Format(PyExc_TypeError,
+ "object of type '%.100s' is not callable",
+ func->ob_type->tp_name);
return NULL;
}
if (result == NULL && !PyErr_Occurred())