]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Don't traceback when wakeup() is called when the window has been destroyed.
authorGuido van Rossum <guido@python.org>
Sat, 9 Jan 1999 22:01:33 +0000 (22:01 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 9 Jan 1999 22:01:33 +0000 (22:01 +0000)
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

index b9b0bb115225cf77453734a4b2a92473cad706ab..9eb7f3dd5e77bf96cd23e4f85311177590eb762e 100644 (file)
@@ -48,6 +48,11 @@ class ListedToplevel(Toplevel):
         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