]> granicus.if.org Git - python/commitdiff
Mention type in the exception message.
authorWalter Dörwald <walter@livinglogic.de>
Wed, 9 May 2007 10:39:19 +0000 (10:39 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Wed, 9 May 2007 10:39:19 +0000 (10:39 +0000)
Objects/unicodeobject.c

index 9dc96da73c7f97c1d01a55bbaf878f866edd760f..a0740db1073076a320cb08363a4f473744d134ab 100644 (file)
@@ -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;
     }