You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* If Tcl is compiled for threads, we must also define TCL_THREAD. We define it always; if Tcl is not threaded, the thread functions in Tcl are empty. */#defineTCL_THREADS
but in two places in Modules/_tkinter.c , we check if TCL_THREADS is defined:
tcl/tk 8.5 was by default compiled without thread_support. 8.6 by default is, and perhaps the option is gone. Thread support was once optional in python, but now is mandatory so _tkinter should support them also.
I suspect that the define and the comment before could be eliminated (if these are the only two uses) and the code between #ifdef TCL_THREADS and #ELSE# made unconditional and the other code eliminated. @serhiy-storchaka ?
I think we can drop support of non-threaded Tcl/Tk in main. AFAIK, 8.6 is threaded by default, and 9.0 is always threaded. But the minimal supported version was still 8.5.12. Some distributors can still need to build without threaded support, they may even patch #define TCL_THREADS. So this is main-only change.
To make backporting easier, it is better to hold these changes until we fix other issues.
Activity
terryjreedy commentedon Oct 23, 2025
tcl/tk 8.5 was by default compiled without thread_support. 8.6 by default is, and perhaps the option is gone. Thread support was once optional in python, but now is mandatory so _tkinter should support them also.
I suspect that the define and the comment before could be eliminated (if these are the only two uses) and the code between
#ifdef TCL_THREADSand #ELSE# made unconditional and the other code eliminated. @serhiy-storchaka ?serhiy-storchaka commentedon Oct 23, 2025
It was unconditionally enabled in b5bfb9f, 23 years ago. Well, I think we can remove this code now. Note that some comments may be need to be updated.
mdehoon commentedon Oct 24, 2025
We still need to #define TCL_THREADS , otherwise tkinter won't compile.
Should we require that tcl/tk was compiled with thread support, or should we still allow tcl/tk without thread support?
serhiy-storchaka commentedon Jul 17, 2026
I think we can drop support of non-threaded Tcl/Tk in main. AFAIK, 8.6 is threaded by default, and 9.0 is always threaded. But the minimal supported version was still 8.5.12. Some distributors can still need to build without threaded support, they may even patch
#define TCL_THREADS. So this is main-only change.To make backporting easier, it is better to hold these changes until we fix other issues.