Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41f0a98

Browse files
committed
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.
1 parent 69ef7d6 commit 41f0a98

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Modules/_tkinter.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,9 +1899,6 @@ static PyThreadState *event_tstate = NULL;
18991899
static int
19001900
EventHook()
19011901
{
1902-
#if defined(WITH_THREAD) || defined(MS_WINDOWS)
1903-
PyThreadState *tstate = PyThreadState_Get();
1904-
#endif
19051902
#ifndef MS_WINDOWS
19061903
FHANDLE tfile;
19071904
#endif
@@ -1923,7 +1920,7 @@ EventHook()
19231920
#if defined(WITH_THREAD) || defined(MS_WINDOWS)
19241921
Py_BEGIN_ALLOW_THREADS
19251922
acquire_lock(tcl_lock, 1);
1926-
tcl_tstate = tstate;
1923+
tcl_tstate = event_tstate;
19271924

19281925
result = Tcl_DoOneEvent(TCL_DONT_WAIT);
19291926

0 commit comments

Comments
 (0)