(Merge 3.2) Issue #12342: Improve _tkinter error message on unencodable character

This commit is contained in:
Victor Stinner 2011-11-04 00:43:35 +01:00
commit 6777e6f9b1
1 changed files with 4 additions and 2 deletions

View File

@ -990,8 +990,10 @@ AsObj(PyObject *value)
#if TCL_UTF_MAX == 3 #if TCL_UTF_MAX == 3
if (ch >= 0x10000) { if (ch >= 0x10000) {
/* Tcl doesn't do UTF-16, yet. */ /* Tcl doesn't do UTF-16, yet. */
PyErr_SetString(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"unsupported character"); "character U+%x is above the range "
"(U+0000-U+FFFF) allowed by Tcl",
inbuf[i]);
ckfree(FREECAST outbuf); ckfree(FREECAST outbuf);
return NULL; return NULL;
#endif #endif