From: Guido van Rossum Date: Thu, 9 Aug 2007 21:47:11 +0000 (+0000) Subject: Backport r56875 from py3k; double LEAVE_PYTHON when AsString() fails X-Git-Tag: v2.6a1~1516 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5e81aa53efd10c630624bb861b46f310b07ecbb;p=python Backport r56875 from py3k; double LEAVE_PYTHON when AsString() fails in PythonCmd(). --- diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 07570f3ab0..d26728c15f 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -2028,7 +2028,9 @@ PythonCmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) s = AsString(res, tmp); if (s == NULL) { - rv = PythonCmd_Error(interp); + Py_DECREF(res); + Py_DECREF(tmp); + return PythonCmd_Error(interp); } else { Tcl_SetResult(Tkapp_Interp(self), s, TCL_VOLATILE);