From 31f477c7eb831f044c1628d6d9acf86f6881cead Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 20 Sep 2013 23:21:44 +0300 Subject: [PATCH] Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call returned empty string. --- Misc/NEWS | 3 +++ Modules/_tkinter.c | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 451aba63bae..c3d9e9ed776 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -68,6 +68,9 @@ Core and Builtins Library ------- +- Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call + returned empty string. + - Issue #18050: Fixed an incompatibility of the re module with Python 3.3.0 binaries. diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index e6b72d39172..1350ff5cb95 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1227,10 +1227,7 @@ Tkapp_CallResult(TkappObject *self) res = FromObj((PyObject*)self, value); Tcl_DecrRefCount(value); } else { - const char *s = Tcl_GetStringResult(self->interp); - const char *p = s; - - res = PyUnicode_FromStringAndSize(s, (int)(p-s)); + res = PyUnicode_FromString(Tcl_GetStringResult(self->interp)); } return res; }