]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove "disgusting hack" in favour of closure (patch #1462235)
authorGeorg Brandl <georg@python.org>
Sun, 2 Apr 2006 21:09:51 +0000 (21:09 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 2 Apr 2006 21:09:51 +0000 (21:09 +0000)
Lib/lib-tk/Tkinter.py

index 37ddd3a4cb7eacc583593e5dbda71cea26f22f06..5bd7aa9d491b0646381bf69ad17821e7f404f962 100644 (file)
@@ -449,18 +449,15 @@ class Misc:
             # I'd rather use time.sleep(ms*0.001)
             self.tk.call('after', ms)
         else:
-            # XXX Disgusting hack to clean up after calling func
-            tmp = []
-            def callit(func=func, args=args, self=self, tmp=tmp):
+            def callit():
                 try:
                     func(*args)
                 finally:
                     try:
-                        self.deletecommand(tmp[0])
+                        self.deletecommand(name)
                     except TclError:
                         pass
             name = self._register(callit)
-            tmp.append(name)
             return self.tk.call('after', ms, name)
     def after_idle(self, func, *args):
         """Call FUNC once if the Tcl main loop has no event to