From 0c92000b7a679f1c8add378bb36c6c08efe6f6eb Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 14 Sep 1998 19:06:39 +0000 Subject: 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. --- Lib/lib-tk/Tkinter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 4bcb632..ae6cfb5 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) -- cgit v0.12