]> granicus.if.org Git - python/commitdiff
Backport r56875 from py3k; double LEAVE_PYTHON when AsString() fails
authorGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 21:47:11 +0000 (21:47 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 21:47:11 +0000 (21:47 +0000)
in PythonCmd().

Modules/_tkinter.c

index 07570f3ab02ace2fda5a70e6c8e093c82477087b..d26728c15f6562123328956b051b715787223927 100644 (file)
@@ -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);