From: Guido van Rossum Date: Mon, 12 Oct 1998 16:26:22 +0000 (+0000) Subject: Looks like I didn't test this interactively. The EventHook() code was X-Git-Tag: v1.5.2a2~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41f0a98f8f22d37ce721aa0a5d4285b3e4b2e7d7;p=python Looks like I didn't test this interactively. The EventHook() code was broken; it asked for the current thread state when there was none. Fixed by using the saved event_tstate. --- diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index b5be260f78..5939a06da0 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1899,9 +1899,6 @@ static PyThreadState *event_tstate = NULL; static int EventHook() { -#if defined(WITH_THREAD) || defined(MS_WINDOWS) - PyThreadState *tstate = PyThreadState_Get(); -#endif #ifndef MS_WINDOWS FHANDLE tfile; #endif @@ -1923,7 +1920,7 @@ EventHook() #if defined(WITH_THREAD) || defined(MS_WINDOWS) Py_BEGIN_ALLOW_THREADS acquire_lock(tcl_lock, 1); - tcl_tstate = tstate; + tcl_tstate = event_tstate; result = Tcl_DoOneEvent(TCL_DONT_WAIT);