[Python-checkins] cpython (merge 3.2 -> 3.3): Issue #13153: Tkinter functions now raise TclError instead of ValueError when

serhiy.storchaka python-checkins at python.org
Mon Feb 18 12:07:11 CET 2013


http://hg.python.org/cpython/rev/38bb2a46692e
changeset:   82253:38bb2a46692e
branch:      3.3
parent:      82249:aad7e68eff0a
parent:      82252:9904f245c3f0
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Feb 18 13:02:41 2013 +0200
summary:
  Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a string argument contains non-BMP character.

files:
  Misc/NEWS          |  3 +++
  Modules/_tkinter.c |  2 +-
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -178,6 +178,9 @@
 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.
 
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -990,7 +990,7 @@
 #if TCL_UTF_MAX == 3
             if (ch >= 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",
                              ch);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list