]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 26 Jun 2026 23:00:38 +0000 (02:00 +0300)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2026 23:00:38 +0000 (02:00 +0300)
commit5fed5ce85d9c862673cc68294f757f345bbcc9b1
treeab2c439286d0c3c5b191d596555f272b814f5f8f
parent8f4abfc39256b4081d9f08125780143036900aaf
gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337)

focus_get(), focus_displayof(), focus_lastfor() and winfo_containing()
now return None instead of raising KeyError when the focused widget was
not created by tkinter (for example a torn-off menu).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_tkinter/test_misc.py
Lib/tkinter/__init__.py
Misc/NEWS.d/next/Library/2026-06-26-15-30-00.gh-issue-88758.Qw7nLp.rst [new file with mode: 0644]