summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-09 10:39:19 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-09 10:39:19 (GMT)
commit580ceedd0640edc4b646ee09f29cf1e3ed373122 (patch)
tree51f07cfa4a7764498fb8b9536be8704a2a24b982 /Objects
parente6d3904c224b6c53abc3a807158e677f0233d143 (diff)
downloadcpython-580ceedd0640edc4b646ee09f29cf1e3ed373122.zip
cpython-580ceedd0640edc4b646ee09f29cf1e3ed373122.tar.gz
cpython-580ceedd0640edc4b646ee09f29cf1e3ed373122.tar.bz2
Mention type in the exception message.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c5
1 files changed, 3 insertions, 2 deletions
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 @@ 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;
}