mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
Mention type in the exception message.
This commit is contained in:
parent
e6d3904c22
commit
580ceedd06
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue