summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-03 23:36:46 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-03 23:36:46 (GMT)
commit7ab4192e82154e6d61b635f493ed6c36231614ad (patch)
treee92a0a92633e04faec0b325730ceef1e48c4a38b /Modules
parentb3bc7e764db4327953aaaf1316e0edc0ff6b16fb (diff)
downloadcpython-7ab4192e82154e6d61b635f493ed6c36231614ad.zip
cpython-7ab4192e82154e6d61b635f493ed6c36231614ad.tar.gz
cpython-7ab4192e82154e6d61b635f493ed6c36231614ad.tar.bz2
Issue #12342: Improve _tkinter error message on unencodable character
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 672837f..3608e2d 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -993,8 +993,10 @@ AsObj(PyObject *value)
for (i = 0; i < size; i++) {
if (inbuf[i] >= 0x10000) {
/* Tcl doesn't do UTF-16, yet. */
- PyErr_SetString(PyExc_ValueError,
- "unsupported character");
+ PyErr_Format(PyExc_ValueError,
+ "character U+%x is above the range "
+ "(U+0000-U+FFFF) allowed by Tcl",
+ inbuf[i]);
ckfree(FREECAST outbuf);
return NULL;
}