[Python-checkins] r62951 - sandbox/trunk/ttk-gsoc/Lib/lib-tk/Ttk.py
guilherme.polo
python-checkins at python.org
Fri May 9 20:58:33 CEST 2008
Author: guilherme.polo
Date: Fri May 9 20:58:33 2008
New Revision: 62951
Log:
More generic support for empty values in _format_optdict.
Modified:
sandbox/trunk/ttk-gsoc/Lib/lib-tk/Ttk.py
Modified: sandbox/trunk/ttk-gsoc/Lib/lib-tk/Ttk.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/Lib/lib-tk/Ttk.py (original)
+++ sandbox/trunk/ttk-gsoc/Lib/lib-tk/Ttk.py Fri May 9 20:58:33 2008
@@ -63,10 +63,8 @@
# value is expected to be a sequence
value = format % ' '.join(map(str, value))
- elif isinstance(value, basestring):
- # if an empty string was passed, we need to convert it to the Tcl
- # equivalent ({})
- value = value or '{}'
+ if not value: # empty string in Python is equivalent to {} in Tcl
+ value = '{}'
opts.append(("-%s" % opt, value))
More information about the Python-checkins
mailing list