summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-02 19:30:30 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-02 19:30:30 (GMT)
commit3bbc62e9c25d4c006cd21d6b1314ccf0ba211382 (patch)
tree0b1a6d87c3bd250a62235f9df6ed9fffddbbabae /Modules/_tkinter.c
parent437a0e60baa6eabc2c853bee7ce1543481db8ca7 (diff)
downloadcpython-3bbc62e9c25d4c006cd21d6b1314ccf0ba211382.zip
cpython-3bbc62e9c25d4c006cd21d6b1314ccf0ba211382.tar.gz
cpython-3bbc62e9c25d4c006cd21d6b1314ccf0ba211382.tar.bz2
Another bulky set of minor changes.
Note addition of gethostbyaddr() and improved repr() for sockets, renaming of md5.md5() to md5.new(), and fixing of leaks in threads.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 6104960..77b1809 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -41,6 +41,7 @@ static int quitMainLoop = 0;
static int errorInCmd = 0;
static PyObject *excInCmd;
static PyObject *valInCmd;
+static PyObject *trbInCmd;
static PyObject *
Tkinter_Error (v)
@@ -55,7 +56,7 @@ PythonCmd_Error (interp)
Tcl_Interp *interp;
{
errorInCmd = 1;
- PyErr_GetAndClear (&excInCmd, &valInCmd);
+ PyErr_Fetch (&excInCmd, &valInCmd, &trbInCmd);
return TCL_ERROR;
}
@@ -759,7 +760,7 @@ FileHandler (clientData, mask)
if (res == NULL)
{
errorInCmd = 1;
- PyErr_GetAndClear (&excInCmd, &valInCmd);
+ PyErr_Fetch (&excInCmd, &valInCmd, &trbInCmd);
}
Py_XDECREF (res);
}
@@ -964,9 +965,10 @@ TimerHandler (clientData)
if (res == NULL)
{
errorInCmd = 1;
- PyErr_GetAndClear (&excInCmd, &valInCmd);
+ PyErr_Fetch (&excInCmd, &valInCmd, &trbInCmd);
}
- Py_DECREF (res);
+ else
+ Py_DECREF (res);
}
static PyObject *
@@ -1020,7 +1022,8 @@ Tkapp_MainLoop (self, args)
if (errorInCmd)
{
errorInCmd = 0;
- PyErr_SetObject (excInCmd, valInCmd);
+ PyErr_Restore (excInCmd, valInCmd, trbInCmd);
+ excInCmd = valInCmd = trbInCmd = NULL;
return NULL;
}
Py_INCREF (Py_None);
@@ -1173,7 +1176,8 @@ EventHook ()
if (errorInCmd) /* XXX Reset tty */
{
errorInCmd = 0;
- PyErr_SetObject (excInCmd, valInCmd);
+ PyErr_Restore (excInCmd, valInCmd, trbInCmd);
+ excInCmd = valInCmd = trbInCmd = NULL;
PyErr_Print ();
}
if (tk_NumMainWindows > 0)