diff options
author | Guido van Rossum <guido@python.org> | 1999-01-09 22:01:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-01-09 22:01:33 (GMT) |
commit | 2403b0c5d4cb3468056df567b513b2f0f03dc481 (patch) | |
tree | 5e6f075937effd089b9d066a153fbfc232b65da1 /Tools/idle/WindowList.py | |
parent | f52cca9812b1d06b46e9cf4fda799941f8a724e4 (diff) | |
download | cpython-2403b0c5d4cb3468056df567b513b2f0f03dc481.zip cpython-2403b0c5d4cb3468056df567b513b2f0f03dc481.tar.gz cpython-2403b0c5d4cb3468056df567b513b2f0f03dc481.tar.bz2 |
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...
Diffstat (limited to 'Tools/idle/WindowList.py')
-rw-r--r-- | Tools/idle/WindowList.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Tools/idle/WindowList.py b/Tools/idle/WindowList.py index b9b0bb1..9eb7f3d 100644 --- a/Tools/idle/WindowList.py +++ b/Tools/idle/WindowList.py @@ -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 |