Commit 7eb4a821 authored by Georg Brandl's avatar Georg Brandl

Fix tkinter sequence passing. #2906. Backport from r63914.

parent 9aa040d4
...@@ -1056,11 +1056,17 @@ class Misc: ...@@ -1056,11 +1056,17 @@ class Misc:
if callable(v): if callable(v):
v = self._register(v) v = self._register(v)
elif isinstance(v, (tuple, list)): elif isinstance(v, (tuple, list)):
nv = []
for item in v: for item in v:
if not isinstance(item, (basestring, int)): if not isinstance(item, (basestring, int)):
break break
elif isinstance(item, int):
nv.append('%d' % item)
else: else:
v = ' '.join(map(str, v)) # format it to proper Tcl code if it contains space
nv.append(('{%s}' if ' ' in item else '%s') % item)
else:
v = ' '.join(nv)
res = res + ('-'+k, v) res = res + ('-'+k, v)
return res return res
def nametowidget(self, name): def nametowidget(self, name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment