comparison Modules/_tkinter.c @ 82251:bb5a8564e186 2.7

Issue #13153: Tkinter functions now raise TclError instead of ValueError when a unicode argument contains non-BMP character.
author Serhiy Storchaka <storchaka@gmail.com>
date Mon, 18 Feb 2013 13:00:08 +0200
parents 60d80880bf88
children f53cdd4e2689
comparison
equal deleted inserted replaced
82247:50ed06b3d419 82251:bb5a8564e186
985 return NULL; 985 return NULL;
986 } 986 }
987 for (i = 0; i < size; i++) { 987 for (i = 0; i < size; i++) {
988 if (inbuf[i] >= 0x10000) { 988 if (inbuf[i] >= 0x10000) {
989 /* Tcl doesn't do UTF-16, yet. */ 989 /* Tcl doesn't do UTF-16, yet. */
990 PyErr_SetString(PyExc_ValueError, 990 PyErr_Format(Tkinter_TclError,
991 "unsupported character"); 991 "character U+%x is above the range "
992 "(U+0000-U+FFFF) allowed by Tcl",
993 (int)inbuf[i]);
992 ckfree(FREECAST outbuf); 994 ckfree(FREECAST outbuf);
993 return NULL; 995 return NULL;
994 } 996 }
995 outbuf[i] = inbuf[i]; 997 outbuf[i] = inbuf[i];
996 } 998 }