diff options
author | Guido van Rossum <guido@python.org> | 2007-08-09 21:42:19 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-09 21:42:19 (GMT) |
commit | 516f41e032e612e5bc6b7093ac31215abbe8f31d (patch) | |
tree | 725a182e2e0ae2eeaec74b1e3e9433fbac245119 /Modules | |
parent | 9ce8e3809906a0e7a01b548883b85d0e323d2f6d (diff) | |
download | cpython-516f41e032e612e5bc6b7093ac31215abbe8f31d.zip cpython-516f41e032e612e5bc6b7093ac31215abbe8f31d.tar.gz cpython-516f41e032e612e5bc6b7093ac31215abbe8f31d.tar.bz2 |
Fix some logic in PythonCmd() -- if the AsString() call failed, we'd
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.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tkinter.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index e9dc72b..df281cd 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -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); |