Always convert Text.index result to string.

This improves compatibility with Tcl 8.5, which would
otherwise return textindex objects.
This commit is contained in:
Martin v. Löwis 2008-01-01 21:08:18 +00:00
parent 17cb5cf403
commit f5d902fc47
1 changed files with 1 additions and 1 deletions

View File

@ -2981,7 +2981,7 @@ class Text(Widget):
return self.tk.call(self._w, "image", "names") return self.tk.call(self._w, "image", "names")
def index(self, index): def index(self, index):
"""Return the index in the form line.char for INDEX.""" """Return the index in the form line.char for INDEX."""
return self.tk.call(self._w, 'index', index) return str(self.tk.call(self._w, 'index', index))
def insert(self, index, chars, *args): def insert(self, index, chars, *args):
"""Insert CHARS before the characters at INDEX. An additional """Insert CHARS before the characters at INDEX. An additional
tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.""" tag can be given in ARGS. Additional CHARS and tags can follow in ARGS."""