Ivan Pozdeev <ivan_pozd...@mail.ru> added the comment: Attached a fixed script.
`Tk.after()` works from a worker thread, while `Tk.destroy()` doesn't. That's because Tkinter implements Tcl calls (_tkinter.c:Tkapp_Call) from another thread by posting an event to the interpreter's queue (Tcl_ThreadQueueEvent) and waiting for result. So a call normally works, but would hang if the interpreter's event loop is not running. `destroy()`'s Python part (Lib\tkinter\__init__.py:2055) stops the event loop, then makes more Tcl calls -- which hang for the aforementioned reason if made from another thread. ---------- Added file: https://bugs.python.org/file47570/TkinterHanders32.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33412> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com