]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] 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:28:01 +0000 (01:28 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2026 23:28:01 +0000 (23:28 +0000)
commit5730c9089393b70978f3973e0f69a6969a9ba53f
tree5cc3e5fd90bcda27db79a98603bb151780d4438f
parentee1ae1dba1244baf466eaa695fcaacfaa3736943
[3.14] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337) (GH-152347)

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]