Commit 169e2a1a authored by Neal Norwitz's avatar Neal Norwitz

Fix SF #692416, don't crash interpreter for _tkinter.deletefilehandler

in addition to createfilehandler and creaetetimerhandler.
parent c9e8e312
......@@ -24,6 +24,10 @@ Core and builtins
Extension modules
-----------------
- Using createfilehandler, deletefilehandler, createtimerhandler functions
on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
See SF bug #692416.
- Modified the fcntl.ioctl() function to allow modification of a passed
mutable buffer (for details see the reference documentation).
......
......@@ -2243,7 +2243,19 @@ Tkapp_DeleteFileHandler(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file))
return NULL;
if (!self && !tcl_lock) {
/* We don't have the Tcl lock since Tcl is threaded. */
PyErr_SetString(PyExc_RuntimeError,
"_tkinter.deletefilehandler not supported "
"for threaded Tcl");
return NULL;
}
if (self) {
CHECK_TCL_APPARTMENT;
}
tfile = PyObject_AsFileDescriptor(file);
if (tfile < 0)
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment