summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-06-16 00:09:28 +0000
committerTim Peters <tim.peters@gmail.com>2001-06-16 00:09:28 +0000
commitf1c43da3b6da17eee0f7e7b11f3c7c1b85748940 (patch)
treeaa650ecf2d6c20c29d050c17f18a378804dcce76
parentbb6ee84632b64e26e2b67fd28790cb592076ece3 (diff)
downloadcpython-f1c43da3b6da17eee0f7e7b11f3c7c1b85748940.tar.gz
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.
-rw-r--r--Python/ceval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ceecdb15ef..7f668fca9c 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())