diff options
author | Georg Brandl <georg@python.org> | 2008-06-03 10:23:15 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-06-03 10:23:15 +0000 |
commit | f46b73632a48dd56d68ef1f86ffb597a3fd6959e (patch) | |
tree | e767508f4d67a2b5d69578f70fd3edc645054c90 /Lib/lib-tk | |
parent | 25ce23a42005fce86db3c16feda4a87dda8e404e (diff) | |
download | cpython-f46b73632a48dd56d68ef1f86ffb597a3fd6959e.tar.gz |
Fix Tkinter sequence passing. #2906.
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 8bd3f50f6b..549e0738af 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -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): |