Skip to content

[3.15] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337)#152346

Merged
serhiy-storchaka merged 1 commit into
python:3.15from
miss-islington:backport-5fed5ce-3.15
Jun 26, 2026
Merged

[3.15] gh-88758: Handle non-tkinter widgets in tkinter focus methods (GH-152337)#152346
serhiy-storchaka merged 1 commit into
python:3.15from
miss-islington:backport-5fed5ce-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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 5fed5ce)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
Co-authored-by: Claude Opus 4.8 noreply@anthropic.com

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

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 26, 2026 23:01
@serhiy-storchaka serhiy-storchaka merged commit 90528ec into python:3.15 Jun 26, 2026
55 checks passed
@miss-islington miss-islington deleted the backport-5fed5ce-3.15 branch June 26, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants