Skip to content

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

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

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

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

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:02
@serhiy-storchaka serhiy-storchaka merged commit cee7232 into python:3.13 Jun 26, 2026
41 of 42 checks passed
@miss-islington miss-islington deleted the backport-5fed5ce-3.13 branch June 26, 2026 23:31
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