| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Without a timeout wait_variable() blocks forever if the variable is never set, for example because the window that would set it was destroyed. The new keyword-only timeout parameter bounds the wait and returns whether the variable was modified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Documentation build overview3 files changed ± library/tkinter.html ± whatsnew/3.16.html ± whatsnew/changelog.html |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Misc.wait_variable() wraps the Tcl tkwait variable command, which blocks until the variable is written — with no escape if that never happens (e.g. the application is torn down before the setter runs), so the call can hang forever.
Add an optional keyword-only timeout argument (in seconds).
With a timeout the wait is reimplemented in Python on top of tkapp.dooneevent() and a variable trace: it returns True if the variable was modified, or False if the timeout elapsed first (or the application was destroyed while waiting).
Without a timeout the behaviour is unchanged (the native tkwait call, always returns True).