]> granicus.if.org Git - python/commitdiff
In _bind(), found a way to test for break without a temp variable.
authorGuido van Rossum <guido@python.org>
Wed, 29 Apr 1998 22:16:57 +0000 (22:16 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 29 Apr 1998 22:16:57 +0000 (22:16 +0000)
Lib/lib-tk/Tkinter.py

index 9291ab5b908488dbefbfbe35271b570516958d09..4a94c38c812868a7704f642215f735fc049ed1b4 100644 (file)
@@ -457,11 +457,11 @@ class Misc:
                if func:
                        funcid = self._register(func, self._substitute,
                                                needcleanup)
-                       cmd = ("%sset _tkinter_break [%s %s]\n"
-                              'if {"$_tkinter_break" == "break"} break\n') \
-                              (add and '+' or '',
-                                 funcid,
-                                 _string.join(self._subst_format))
+                       cmd = ('%sif {"[%s %s]" == "break"} break\n'
+                              %
+                              (add and '+' or '',
+                               funcid,
+                               _string.join(self._subst_format)))
                        self.tk.call(what + (sequence, cmd))
                        return funcid
                elif func == '':