[Python-checkins] python/dist/src/Modules _tkinter.c,1.150,1.151

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Mon, 03 Mar 2003 13:16:42 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv30451/Modules

Modified Files:
	_tkinter.c 
Log Message:
Fix SF #692416, don't crash interpreter for _tkinter.deletefilehandler
in addition to createfilehandler and creaetetimerhandler.


Index: _tkinter.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -C2 -d -r1.150 -r1.151
*** _tkinter.c	3 Mar 2003 10:40:01 -0000	1.150
--- _tkinter.c	3 Mar 2003 21:16:39 -0000	1.151
***************
*** 2244,2248 ****
  	if (!PyArg_ParseTuple(args, "O:deletefilehandler", &file))
  		return NULL;
! 	CHECK_TCL_APPARTMENT;
  	tfile = PyObject_AsFileDescriptor(file);
  	if (tfile < 0)
--- 2244,2260 ----
  	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)