[Python-checkins] python/dist/src/Modules _tkinter.c,1.143,1.144

loewis@users.sourceforge.net loewis@users.sourceforge.net
Sat, 04 Jan 2003 00:37:00 -0800


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

Modified Files:
	_tkinter.c 
Log Message:
Remove appartment check from dooneevent. Fixes #660961.
Check whether self is NULL in mainloop.


Index: _tkinter.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** _tkinter.c	4 Jan 2003 00:33:13 -0000	1.143
--- _tkinter.c	4 Jan 2003 08:36:57 -0000	1.144
***************
*** 2417,2424 ****
  		return NULL;
  
! 	CHECK_TCL_APPARTMENT;
  
  	quitMainLoop = 0;
- 	self->dispatching = 1;
  	while (Tk_GetNumMainWindows() > threshold &&
  	       !quitMainLoop &&
--- 2417,2434 ----
  		return NULL;
  
! 	if (!self && !tcl_lock) {
! 		/* We don't have the Tcl lock since Tcl is threaded. */
! 		PyErr_SetString(PyExc_RuntimeError,
! 				"_tkinter.mainloop not supported "
! 				"for threaded Tcl");
! 		return NULL;
! 	}
! 
! 	if (self) {
! 		CHECK_TCL_APPARTMENT;
! 		self->dispatching = 1;
! 	}
  
  	quitMainLoop = 0;
  	while (Tk_GetNumMainWindows() > threshold &&
  	       !quitMainLoop &&
***************
*** 2428,2432 ****
  
  #ifdef WITH_THREAD
! 		if (self->threaded) {
  			/* Allow other Python threads to run. */
  			ENTER_TCL
--- 2438,2442 ----
  
  #ifdef WITH_THREAD
! 		if (self && self->threaded) {
  			/* Allow other Python threads to run. */
  			ENTER_TCL
***************
*** 2450,2454 ****
  
  		if (PyErr_CheckSignals() != 0) {
! 			self->dispatching = 0;
  			return NULL;
  		}
--- 2460,2465 ----
  
  		if (PyErr_CheckSignals() != 0) {
! 			if (self)
! 				self->dispatching = 0;
  			return NULL;
  		}
***************
*** 2456,2460 ****
  			break;
  	}
! 	self->dispatching = 0;
  	quitMainLoop = 0;
  
--- 2467,2472 ----
  			break;
  	}
! 	if (self)
! 		self->dispatching = 0;
  	quitMainLoop = 0;
  
***************
*** 2477,2481 ****
  	if (!PyArg_ParseTuple(args, "|i:dooneevent", &flags))
  		return NULL;
- 	CHECK_TCL_APPARTMENT;
  
  	ENTER_TCL
--- 2489,2492 ----