Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc59340

Browse files
committed
In _bind(), found a way to test for break without a temp variable.
1 parent f975699 commit dc59340

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/lib-tk/Tkinter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,11 @@ def _bind(self, what, sequence, func, add, needcleanup=1):
457457
if func:
458458
funcid = self._register(func, self._substitute,
459459
needcleanup)
460-
cmd = ("%sset _tkinter_break [%s %s]\n"
461-
'if {"$_tkinter_break" == "break"} break\n') \
462-
% (add and '+' or '',
463-
funcid,
464-
_string.join(self._subst_format))
460+
cmd = ('%sif {"[%s %s]" == "break"} break\n'
461+
%
462+
(add and '+' or '',
463+
funcid,
464+
_string.join(self._subst_format)))
465465
self.tk.call(what + (sequence, cmd))
466466
return funcid
467467
elif func == '':

0 commit comments

Comments
 (0)