[Python-checkins] r74455 - python/branches/tk_and_idle_maintenance/Lib/idlelib/PyShell.py
guilherme.polo
python-checkins at python.org
Sat Aug 15 03:31:21 CEST 2009
Author: guilherme.polo
Date: Sat Aug 15 03:31:20 2009
New Revision: 74455
Log:
The tuple items returned by Text.tag_ranges might be instances of Tcl_Obj.
Modified:
python/branches/tk_and_idle_maintenance/Lib/idlelib/PyShell.py
Modified: python/branches/tk_and_idle_maintenance/Lib/idlelib/PyShell.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/idlelib/PyShell.py (original)
+++ python/branches/tk_and_idle_maintenance/Lib/idlelib/PyShell.py Sat Aug 15 03:31:20 2009
@@ -245,10 +245,12 @@
self.breakpoints = linenumber_list
def ranges_to_linenumbers(self, ranges):
+ """Convert a tuple of ranges returned by Text.tag_ranges to
+ line numbers."""
lines = []
for index in range(0, len(ranges), 2):
- lineno = int(float(ranges[index]))
- end = int(float(ranges[index+1]))
+ lineno = int(float(str(ranges[index])))
+ end = int(float(str(ranges[index+1])))
while lineno < end:
lines.append(lineno)
lineno += 1
More information about the Python-checkins
mailing list