summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-07-11 17:36:00 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-07-11 17:36:00 (GMT)
commit50ae3f680b43eda435daba083a1e4b41eecc4e58 (patch)
tree20d993af8eb6c7f4737e25fd6a8417c0493fec7b /Modules/_tkinter.c
parente3ed4edb94cadaef747f6032c52cd903a169883e (diff)
parent275d5fdbe40e172ab2bc99084178cb5f81334a54 (diff)
downloadcpython-50ae3f680b43eda435daba083a1e4b41eecc4e58.zip
cpython-50ae3f680b43eda435daba083a1e4b41eecc4e58.tar.gz
cpython-50ae3f680b43eda435daba083a1e4b41eecc4e58.tar.bz2
Issue #18101: Tcl.split() now process strings nested in a tuple as it
do with byte strings. Added tests for Tcl.split() and Tcl.splitline().
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index eb14827..26f10fd 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -423,6 +423,21 @@ SplitObj(PyObject *arg)
return result;
/* Fall through, returning arg. */
}
+ else if (PyUnicode_Check(arg)) {
+ int argc;
+ char **argv;
+ char *list = PyUnicode_AsUTF8(arg);
+
+ if (list == NULL ||
+ Tcl_SplitList((Tcl_Interp *)NULL, list, &argc, &argv) != TCL_OK) {
+ Py_INCREF(arg);
+ return arg;
+ }
+ Tcl_Free(FREECAST argv);
+ if (argc > 1)
+ return Split(list);
+ /* Fall through, returning arg. */
+ }
else if (PyBytes_Check(arg)) {
int argc;
char **argv;