summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2001-06-27 14:13:32 (GMT)
committerThomas Wouters <thomas@python.org>2001-06-27 14:13:32 (GMT)
commit44c3679296a13aec7b46c0939c183c4d86e7c7ab (patch)
tree883f4d7c7515c9376ba9b8e3e1bcdfade6b4197b /Python
parent5eaa74048fabc67a8b12a14853865150ec688b91 (diff)
downloadcpython-44c3679296a13aec7b46c0939c183c4d86e7c7ab.zip
cpython-44c3679296a13aec7b46c0939c183c4d86e7c7ab.tar.gz
cpython-44c3679296a13aec7b46c0939c183c4d86e7c7ab.tar.bz2
Backport Tim's checkin 2.247:
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.
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 64dbf98..690c653 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2812,8 +2812,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())