[3.14] gh-124111: Fix TCL 9 thread detection (GH-141482)

(cherry picked from commit dc0987080e)

Co-authored-by: Michael Cho <michael@michaelcho.dev>
This commit is contained in:
Miss Islington (bot) 2025-11-12 23:43:31 +01:00 committed by GitHub
parent 4316180426
commit 0b44bc3379
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,2 @@
Updated Tcl threading configuration in :mod:`_tkinter` to assume that
threads are always available in Tcl 9 and later.

View 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;