]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] 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:30:32 +0000 (01:30 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2026 23:30:32 +0000 (23:30 +0000)
commit90528ec04001f0a01e1a6c1565f3837751c013db
treefec954db1eb98afe9150850401fe57458c107829
parentba4084fa1767278b5703cad90c7a15067a3e5017
[3.15] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337) (GH-152346)

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]