]> granicus.if.org Git - python/commitdiff
Always convert Text.index result to string.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 1 Jan 2008 21:08:18 +0000 (21:08 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 1 Jan 2008 21:08:18 +0000 (21:08 +0000)
This improves compatibility with Tcl 8.5, which would
otherwise return textindex objects.

Lib/lib-tk/Tkinter.py

index f3f99f4121ed9a297f31359417bd1e13fa4efe45..3ec3407a4bcefbe514628dca2525bbaee22c3836 100644 (file)
@@ -2981,7 +2981,7 @@ class Text(Widget):
         return self.tk.call(self._w, "image", "names")
     def index(self, 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):
         """Insert CHARS before the characters at INDEX. An additional
         tag can be given in ARGS. Additional CHARS and tags can follow in ARGS."""