]> granicus.if.org Git - python/commitdiff
Ignore the TclError exception raised when deleting the registration
authorGuido van Rossum <guido@python.org>
Mon, 14 Sep 1998 19:06:39 +0000 (19:06 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 14 Sep 1998 19:06:39 +0000 (19:06 +0000)
for callit, used by the after() command.  This can happen when the
callback deletes the window.

Lib/lib-tk/Tkinter.py

index 4bcb63295c7d70f0990a87eb47c3480e72245a29..ae6cfb568aab1226bbe20f766f032c23dc67ff82 100644 (file)
@@ -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)