Mention type in the exception message.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 9dc96da..a0740db 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3528,8 +3528,9 @@
 	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;
     }