From 2403b0c5d4cb3468056df567b513b2f0f03dc481 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sat, 9 Jan 1999 22:01:33 +0000 Subject: [PATCH] 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... --- Tools/idle/WindowList.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Tools/idle/WindowList.py b/Tools/idle/WindowList.py index b9b0bb11522..9eb7f3dd5e7 100644 --- a/Tools/idle/WindowList.py +++ b/Tools/idle/WindowList.py @@ -48,6 +48,11 @@ def get_title(self): return self.wm_title() def wakeup(self): - self.tkraise() - self.wm_deiconify() - self.focus_set() + try: + self.tkraise() + self.wm_deiconify() + self.focus_set() + except TclError: + # This can happen when the window menu was torn off. + # Simply ignore it. + pass