mirror of https://github.com/python/cpython.git
In _bind(), found a way to test for break without a temp variable.
This commit is contained in:
parent
f975699c07
commit
dc59340646
|
@ -457,11 +457,11 @@ def _bind(self, what, sequence, func, add, needcleanup=1):
|
|||
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 == '':
|
||||
|
|
Loading…
Reference in New Issue