diff Python/ceval.c @ 18128:b7f2e2312610 legacy-trunk

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.
author Tim Peters <tim.peters@gmail.com>
date Sat, 16 Jun 2001 00:09:28 +0000
parents 15f4381cff0f
children 4cb34314bd97
line wrap: on
line diff
--- a/Python/ceval.c	Fri Jun 15 21:31:57 2001 +0000
+++ b/Python/ceval.c	Sat Jun 16 00:09:28 2001 +0000
@@ -2862,8 +2862,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())