]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix some logic in PythonCmd() -- if the AsString() call failed, we'd
authorGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 21:42:19 +0000 (21:42 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 21:42:19 +0000 (21:42 +0000)
be calling LEAVE_PYTHON twice (once in PythonCmd_Error() and once in
PythonCmd() itself).

This fix doesn't fix the IDLE problems, but at least makes them more
debuggable by getting rid of the segfault.

Will backport.

Modules/_tkinter.c

index e9dc72bb02a1bd6646c71a0332cc6d7481f402ca..df281cdcaec1e163fe67d8656f753bba7a880923 100644 (file)
@@ -1982,7 +1982,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);