diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-06-01 08:22:21 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-06-01 08:22:21 (GMT) |
commit | 05ef4d3eadeda4a74c4448b67ccf9c5d94422fb9 (patch) | |
tree | 7873f5a670069faa08059733b5e18c2d2b67045e /Lib/tkinter | |
parent | 7be74cffbe96e9649a331260ba0fbf2c2b4a1de0 (diff) | |
parent | 8381f90ee0564745c5b0f59b4ca7e6cef2a54565 (diff) | |
download | cpython-05ef4d3eadeda4a74c4448b67ccf9c5d94422fb9.zip cpython-05ef4d3eadeda4a74c4448b67ccf9c5d94422fb9.tar.gz cpython-05ef4d3eadeda4a74c4448b67ccf9c5d94422fb9.tar.bz2 |
Added missed calls of splitlist().
Diffstat (limited to 'Lib/tkinter')
-rw-r--r-- | Lib/tkinter/font.py | 3 | ||||
-rw-r--r-- | Lib/tkinter/test/test_ttk/test_functions.py | 2 | ||||
-rw-r--r-- | Lib/tkinter/ttk.py | 11 |
3 files changed, 7 insertions, 9 deletions
diff --git a/Lib/tkinter/font.py b/Lib/tkinter/font.py index 4929241..2096093 100644 --- a/Lib/tkinter/font.py +++ b/Lib/tkinter/font.py @@ -81,7 +81,8 @@ class Font: if exists: self.delete_font = False # confirm font exists - if self.name not in root.tk.call("font", "names"): + if self.name not in root.tk.splitlist( + root.tk.call("font", "names")): raise tkinter._tkinter.TclError( "named font %s does not already exist" % (self.name,)) # if font config info supplied, apply it diff --git a/Lib/tkinter/test/test_ttk/test_functions.py b/Lib/tkinter/test/test_ttk/test_functions.py index 8dd8753..41e6311 100644 --- a/Lib/tkinter/test/test_ttk/test_functions.py +++ b/Lib/tkinter/test/test_ttk/test_functions.py @@ -407,8 +407,6 @@ class InternalFunctionsTest(unittest.TestCase): ('name', 'no_minus', 'value')) self.assertRaises(ValueError, ttk._list_from_layouttuple, tk, ('something', '-children')) # no children - self.assertRaises(ValueError, ttk._list_from_layouttuple, tk, - ('something', '-children', 'value')) # invalid children def test_val_or_dict(self): diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py index 81f909c9..c6ca9a5 100644 --- a/Lib/tkinter/ttk.py +++ b/Lib/tkinter/ttk.py @@ -275,6 +275,7 @@ def _list_from_statespec(stuple): def _list_from_layouttuple(tk, ltuple): """Construct a list from the tuple returned by ttk::layout, this is somewhat the reverse of _format_layoutlist.""" + ltuple = tk.splitlist(ltuple) res = [] indx = 0 @@ -293,8 +294,6 @@ def _list_from_layouttuple(tk, ltuple): indx += 2 if opt == 'children': - if not tk.wantobjects(): - val = tk.splitlist(val) val = _list_from_layouttuple(tk, val) opts[opt] = val @@ -408,8 +407,8 @@ class Style(object): return _list_from_statespec(self.tk.splitlist( self.tk.call(self._name, "map", style, '-%s' % query_opt))) - return _dict_from_tcltuple( - self.tk.call(self._name, "map", style, *(_format_mapdict(kw)))) + return _dict_from_tcltuple(self.tk.splitlist( + self.tk.call(self._name, "map", style, *(_format_mapdict(kw))))) def lookup(self, style, option, state=None, default=None): @@ -463,8 +462,8 @@ class Style(object): lspec = "null" # could be any other word, but this may make sense # when calling layout(style) later - return _list_from_layouttuple(self.tk, self.tk.splitlist( - self.tk.call(self._name, "layout", style, lspec))) + return _list_from_layouttuple(self.tk, + self.tk.call(self._name, "layout", style, lspec)) def element_create(self, elementname, etype, *args, **kw): |