diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-07-11 17:34:47 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-07-11 17:34:47 (GMT) |
commit | 275d5fdbe40e172ab2bc99084178cb5f81334a54 (patch) | |
tree | 06df6649374c0982d53b4811b1d63e111357ae92 /Modules/_tkinter.c | |
parent | 5a33f813483325ab3e13596814c3eade6e0bb518 (diff) | |
download | cpython-275d5fdbe40e172ab2bc99084178cb5f81334a54.zip cpython-275d5fdbe40e172ab2bc99084178cb5f81334a54.tar.gz cpython-275d5fdbe40e172ab2bc99084178cb5f81334a54.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.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index d18c7f0..cdb28e5 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -519,6 +519,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; |