diff options
author | Georg Brandl <georg@python.org> | 2008-06-03 10:26:21 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-06-03 10:26:21 +0000 |
commit | 7eb4a82182cf5b886a86f5051c64e1dc3755a9d4 (patch) | |
tree | 0ba90a345e674859f4f8d914bbfc53ce5fa71292 | |
parent | 9aa040d4ab01f34ee1d1e1f95e5678fcb404e430 (diff) | |
download | cpython-git-7eb4a82182cf5b886a86f5051c64e1dc3755a9d4.tar.gz |
Fix tkinter sequence passing. #2906. Backport from r63914.
-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 e1a7629e3e..0ae81e0f2d 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1056,11 +1056,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): |