From a2019e226e4650cef35ebfde7ecd7ce044a4a670 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 19 Dec 2024 16:14:59 -0500 Subject: [PATCH 1/2] gh-124111: Fix TCL 9 threaded detection --- Modules/_tkinter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 45897817a56051..31f744aaf6e9e2 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -583,8 +583,12 @@ Tkapp_New(const char *screenName, const char *className, v->interp = Tcl_CreateInterp(); v->wantobjects = wantobjects; +#if TCL_MAJOR_VERSION >= 9 + v->threaded = 1; +#else v->threaded = Tcl_GetVar2Ex(v->interp, "tcl_platform", "threaded", TCL_GLOBAL_ONLY) != NULL; +#endif v->thread_id = Tcl_GetCurrentThread(); v->dispatching = 0; v->trace = NULL; From ee2bc67beba661de7e3c85e396558bd443734695 Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Wed, 12 Nov 2025 15:43:00 -0600 Subject: [PATCH 2/2] Add blurb --- .../next/Library/2025-11-12-15-42-47.gh-issue-124111.hTw4OE.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2025-11-12-15-42-47.gh-issue-124111.hTw4OE.rst diff --git a/Misc/NEWS.d/next/Library/2025-11-12-15-42-47.gh-issue-124111.hTw4OE.rst b/Misc/NEWS.d/next/Library/2025-11-12-15-42-47.gh-issue-124111.hTw4OE.rst new file mode 100644 index 00000000000000..8436cd2415dbd6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-11-12-15-42-47.gh-issue-124111.hTw4OE.rst @@ -0,0 +1,2 @@ +Updated Tcl threading configuration in :mod:`_tkinter` to assume that +threads are always available in Tcl 9 and later.