Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a unicode argument contains non-BMP character.
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 40c8be2..7872df3 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -987,8 +987,10 @@
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(Tkinter_TclError,
+ "character U+%x is above the range "
+ "(U+0000-U+FFFF) allowed by Tcl",
+ (int)inbuf[i]);
ckfree(FREECAST outbuf);
return NULL;
}