mirror of https://github.com/python/cpython
Fix Tkinter sequence passing. #2906.
This commit is contained in:
parent
c5393c64b8
commit
4ed3ed13c5
|
@ -1054,11 +1054,17 @@ class Misc:
|
|||
if callable(v):
|
||||
v = self._register(v)
|
||||
elif isinstance(v, (tuple, list)):
|
||||
nv = []
|
||||
for item in v:
|
||||
if not isinstance(item, (basestring, int)):
|
||||
break
|
||||
elif isinstance(item, int):
|
||||
nv.append('%d' % item)
|
||||
else:
|
||||
# format it to proper Tcl code if it contains space
|
||||
nv.append(('{%s}' if ' ' in item else '%s') % item)
|
||||
else:
|
||||
v = ' '.join(map(str, v))
|
||||
v = ' '.join(nv)
|
||||
res = res + ('-'+k, v)
|
||||
return res
|
||||
def nametowidget(self, name):
|
||||
|
|
Loading…
Reference in New Issue