Don't traceback when wakeup() is called when the window has been destroyed.

This can happen when a torn-of Windows menu references closed windows.
And Tim Peters claims that the Windows menu is his favorite to tear off...
This commit is contained in:
Guido van Rossum 1999-01-09 22:01:33 +00:00
parent f52cca9812
commit 2403b0c5d4
1 changed files with 8 additions and 3 deletions

View File

@ -48,6 +48,11 @@ class ListedToplevel(Toplevel):
return self.wm_title() return self.wm_title()
def wakeup(self): def wakeup(self):
self.tkraise() try:
self.wm_deiconify() self.tkraise()
self.focus_set() self.wm_deiconify()
self.focus_set()
except TclError:
# This can happen when the window menu was torn off.
# Simply ignore it.
pass