From: Walter Dörwald Date: Wed, 9 May 2007 10:39:19 +0000 (+0000) Subject: Mention type in the exception message. X-Git-Tag: v3.0a1~988 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=580ceedd0640edc4b646ee09f29cf1e3ed373122;p=thirdparty%2FPython%2Fcpython.git Mention type in the exception message. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9dc96da73c7f..a0740db10730 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3528,8 +3528,9 @@ static PyObject *charmapencode_lookup(Py_UNICODE c, PyObject *mapping) return x; else { /* wrong return value */ - PyErr_SetString(PyExc_TypeError, - "character mapping must return integer, None or str"); + PyErr_Format(PyExc_TypeError, + "character mapping must return integer, None or str8, not %.400s", + x->ob_type->tp_name); Py_DECREF(x); return NULL; }