From 580ceedd0640edc4b646ee09f29cf1e3ed373122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Walter=20D=C3=B6rwald?= Date: Wed, 9 May 2007 10:39:19 +0000 Subject: [PATCH] Mention type in the exception message. --- Objects/unicodeobject.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9dc96da73c7..a0740db1073 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; }