summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-06-03 10:25:47 (GMT)
committerGeorg Brandl <georg@python.org>2008-06-03 10:25:47 (GMT)
commit3b55003e33640fa6df00b248216b2abe90fa851b (patch)
treea2ffa5ab662831be9c67b197b9935f6657eced35
parent807a19608a972c4edd7284566507f4f6eacb50d4 (diff)
downloadcpython-3b55003e33640fa6df00b248216b2abe90fa851b.zip
cpython-3b55003e33640fa6df00b248216b2abe90fa851b.tar.gz
cpython-3b55003e33640fa6df00b248216b2abe90fa851b.tar.bz2
Fix Tkinter sequence passing. #2906.
-rw-r--r--Lib/tkinter/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 24badd8..07eb757 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -1052,11 +1052,16 @@ class Misc:
if hasattr(v, '__call__'):
v = self._register(v)
elif isinstance(v, (tuple, list)):
+ nv = []
for item in v:
- if not isinstance(item, (str, int)):
+ if isinstance(item, int):
+ nv.append(str(item))
+ elif isinstance(item, str):
+ nv.append(('{%s}' if ' ' in item else '%s') % item)
+ else:
break
else:
- v = ' '.join(map(str, v))
+ v = ' '.join(nv)
res = res + ('-'+k, v)
return res
def nametowidget(self, name):