summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-09 21:47:11 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-09 21:47:11 (GMT)
commitb5e81aa53efd10c630624bb861b46f310b07ecbb (patch)
treee2bdeb6cc4ac1f3f773f40e0f655404414dd9fbc /Modules/_tkinter.c
parent95d94947f0d0dc269f507961cb491a57352f7bc6 (diff)
downloadcpython-b5e81aa53efd10c630624bb861b46f310b07ecbb.zip
cpython-b5e81aa53efd10c630624bb861b46f310b07ecbb.tar.gz
cpython-b5e81aa53efd10c630624bb861b46f310b07ecbb.tar.bz2
Backport r56875 from py3k; double LEAVE_PYTHON when AsString() fails
in PythonCmd().
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 07570f3..d26728c 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);