Terry J. Reedy <tjre...@udel.edu> added the comment:
Traceback (most recent call last): File "C:\Programs\Python310\lib\tkinter\__init__.py", line 1921, in __call__ return self.func(*args) File "C:\Programs\Python310\lib\tkinter\__init__.py", line 839, in callit func(*args) File "C:\Programs\Python310\lib\tkinter\__init__.py", line 783, in focus_get return self._nametowidget(name) File "C:\Programs\Python310\lib\tkinter\__init__.py", line 1536, in nametowidget w = w.children[n] KeyError: 'e' Is catching KeyError in the following try: # Tcl sometimes returns extra windows, e.g. for # menus; those need to be skipped result.append(self._nametowidget(child)) except KeyError: pass really correct? It appears to skip things that *can* get focus by key or mouse action. But what choice is there? Silently failing when asked to focus on something is even less obviously correct. For 'widget = root.focus_get' to assign None to widget is not obviously useful as it likely just delays the error. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44592> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com