From b5e81aa53efd10c630624bb861b46f310b07ecbb Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 9 Aug 2007 21:47:11 +0000 Subject: [PATCH] Backport r56875 from py3k; double LEAVE_PYTHON when AsString() fails in PythonCmd(). --- Modules/_tkinter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 07570f3ab02..d26728c15f6 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);