diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index d21c6f82c7a..7be94c75034 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -528,7 +528,7 @@ def config(self, cnf=None): apply(self.tk.call, (self._w, 'configure') + self._options(cnf)) def __getitem__(self, key): - v = self.tk.split(self.tk.call( + v = self.tk.splitlist(self.tk.call( self._w, 'configure', '-' + key)) return v[4] def __setitem__(self, key, value): @@ -877,7 +877,9 @@ def entryconfig(self, index, cnf={}): apply(self.tk.call, (self._w, 'entryconfigure', index) + self._options(cnf)) def index(self, index): - return self.tk.call(self._w, 'index', index) + i = self.tk.call(self._w, 'index', index) + if i == 'none': return None + return self.tk.getint(i) def invoke(self, index): return self.tk.call(self._w, 'invoke', index) def post(self, x, y): diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py index d21c6f82c7a..7be94c75034 100755 --- a/Lib/tkinter/Tkinter.py +++ b/Lib/tkinter/Tkinter.py @@ -528,7 +528,7 @@ def config(self, cnf=None): apply(self.tk.call, (self._w, 'configure') + self._options(cnf)) def __getitem__(self, key): - v = self.tk.split(self.tk.call( + v = self.tk.splitlist(self.tk.call( self._w, 'configure', '-' + key)) return v[4] def __setitem__(self, key, value): @@ -877,7 +877,9 @@ def entryconfig(self, index, cnf={}): apply(self.tk.call, (self._w, 'entryconfigure', index) + self._options(cnf)) def index(self, index): - return self.tk.call(self._w, 'index', index) + i = self.tk.call(self._w, 'index', index) + if i == 'none': return None + return self.tk.getint(i) def invoke(self, index): return self.tk.call(self._w, 'invoke', index) def post(self, x, y):