]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 26 Jun 2026 23:31:09 +0000 (01:31 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2026 23:31:09 +0000 (23:31 +0000)
commitcee72326ffc2ec8d98f8d435c62e13a2f5c17edf
tree328e2fc4fb539370dad2a6a34fd8ef7567abcf5f
parent7a835cbbfb40dcefdb64c719e1236102c501448d
[3.13] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337) (GH-152348)

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).
(cherry picked from commit 5fed5ce85d9c862673cc68294f757f345bbcc9b1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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]