mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
In _bind(), found a way to test for break without a temp variable.
This commit is contained in:
parent
f975699c07
commit
dc59340646
1 changed files with 5 additions and 5 deletions
|
@ -457,11 +457,11 @@ class Misc:
|
||||||
if func:
|
if func:
|
||||||
funcid = self._register(func, self._substitute,
|
funcid = self._register(func, self._substitute,
|
||||||
needcleanup)
|
needcleanup)
|
||||||
cmd = ("%sset _tkinter_break [%s %s]\n"
|
cmd = ('%sif {"[%s %s]" == "break"} break\n'
|
||||||
'if {"$_tkinter_break" == "break"} break\n') \
|
%
|
||||||
% (add and '+' or '',
|
(add and '+' or '',
|
||||||
funcid,
|
funcid,
|
||||||
_string.join(self._subst_format))
|
_string.join(self._subst_format)))
|
||||||
self.tk.call(what + (sequence, cmd))
|
self.tk.call(what + (sequence, cmd))
|
||||||
return funcid
|
return funcid
|
||||||
elif func == '':
|
elif func == '':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue