diff Python/ceval.c @ 18319:140cb246b864 2.1

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.
author Thomas Wouters <thomas@python.org>
date Wed, 27 Jun 2001 14:13:32 +0000
parents 9098415971d0
children 325d513a50bb
line wrap: on
line diff
--- a/Python/ceval.c	Wed Jun 27 14:11:12 2001 +0000
+++ b/Python/ceval.c	Wed Jun 27 14:13:32 2001 +0000
@@ -2812,8 +2812,9 @@
 	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())