From: Guido van Rossum Date: Mon, 14 Sep 1998 19:06:39 +0000 (+0000) Subject: Ignore the TclError exception raised when deleting the registration X-Git-Tag: v1.5.2a2~280 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c92000b7a679f1c8add378bb36c6c08efe6f6eb;p=python Ignore the TclError exception raised when deleting the registration for callit, used by the after() command. This can happen when the callback deletes the window. --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 4bcb63295c..ae6cfb568a 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -221,7 +221,10 @@ class Misc: try: apply(func, args) finally: - self.deletecommand(tmp[0]) + try: + self.deletecommand(tmp[0]) + except TclError: + pass name = self._register(callit) tmp.append(name) return self.tk.call('after', ms, name)