]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-124111: Fix TCL 9 thread detection (GH-141482)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 12 Nov 2025 22:43:31 +0000 (23:43 +0100)
committerGitHub <noreply@github.com>
Wed, 12 Nov 2025 22:43:31 +0000 (22:43 +0000)
(cherry picked from commit dc0987080ed66c662e8e0b24cdb8c179817bd697)

Co-authored-by: Michael Cho <michael@michaelcho.dev>
Misc/NEWS.d/next/Library/2025-11-12-15-42-47.gh-issue-124111.hTw4OE.rst [new file with mode: 0644]
Modules/_tkinter.c

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 (file)
index 0000000..8436cd2
--- /dev/null
@@ -0,0 +1,2 @@
+Updated Tcl threading configuration in :mod:`_tkinter` to assume that
+threads are always available in Tcl 9 and later.
index 77695401919cb7a205376b71f9bae5ea13ce2ac3..08fb96169da6c3991f43492746c0169f3247f565 100644 (file)
@@ -599,8 +599,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;