]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #13153: Tkinter functions now raise TclError instead of ValueError when
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 18 Feb 2013 11:01:52 +0000 (13:01 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 18 Feb 2013 11:01:52 +0000 (13:01 +0200)
a string argument contains non-BMP character.

Misc/NEWS
Modules/_tkinter.c

index 747a3aa154bde45521ecd6ccabb11393d05a3076..51f6f1b78d64d5e77957ebd56b903dc7d74f1b3c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -224,6 +224,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #13153: Tkinter functions now raise TclError instead of ValueError when
+  a string argument contains non-BMP character.
+
 - Issue #9669: Protect re against infinite loops on zero-width matching in
   non-greedy repeat.  Patch by Matthew Barnett.
 
index 23906dea903b82674ea43c377cfbe64bd3816266..c6a3e388ef3e293e711599a99fb5a3c92711b8ec 100644 (file)
@@ -993,7 +993,7 @@ AsObj(PyObject *value)
         for (i = 0; i < size; i++) {
             if (inbuf[i] >= 0x10000) {
                 /* Tcl doesn't do UTF-16, yet. */
-                PyErr_Format(PyExc_ValueError,
+                PyErr_Format(Tkinter_TclError,
                              "character U+%x is above the range "
                              "(U+0000-U+FFFF) allowed by Tcl",
                              inbuf[i]);