Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a crash in ``_tkinter`` on Windows where ``ENTER_PYTHON`` may try to restore a NULL state.
4 changes: 4 additions & 0 deletions Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ static PyThreadState *tcl_tstate = NULL;

#define ENTER_PYTHON \
{ PyThreadState *tstate = tcl_tstate; tcl_tstate = NULL; \
if(tstate == NULL) { \
PyGILState_STATE gstate = PyGILState_Ensure(); \
tstate = PyThreadState_Get(); \
PyGILState_Release(gstate); } \
Comment thread
E-Paine marked this conversation as resolved.
Resolved
if(tcl_lock) \
PyThread_release_lock(tcl_lock); PyEval_RestoreThread((tstate)); }

Expand Down