diff options
author | Guido van Rossum <guido@python.org> | 2000-03-06 14:16:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-03-06 14:16:41 (GMT) |
commit | 074d6e1f563818d2b56b84a31945c161c538c5c6 (patch) | |
tree | b43d602c17296fa51ecee84db879875734c5923c /Tools/idle/ParenMatch.py | |
parent | 9552665436eb477e9c1f73270dc8ee4cb188bacf (diff) | |
download | cpython-074d6e1f563818d2b56b84a31945c161c538c5c6.zip cpython-074d6e1f563818d2b56b84a31945c161c538c5c6.tar.gz cpython-074d6e1f563818d2b56b84a31945c161c538c5c6.tar.bz2 |
Don't use 1.6-isms (s.startswith()) -- we want to distribute this
before 1.6 is out so it has to be compatible with 1.5.2.
Diffstat (limited to 'Tools/idle/ParenMatch.py')
-rw-r--r-- | Tools/idle/ParenMatch.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/idle/ParenMatch.py b/Tools/idle/ParenMatch.py index d8482b9..9f9e2ea 100644 --- a/Tools/idle/ParenMatch.py +++ b/Tools/idle/ParenMatch.py @@ -177,10 +177,10 @@ class LastOpenBracketFinder: if i is None \ or keysym_type(buf[i]) != right_keysym_type: return None - lines_back = buf[i:].count("\n") - 1 + lines_back = string.count(buf[i:], "\n") - 1 # subtract one for the "\n" added to please the parser upto_open = buf[:i] - j = upto_open.rfind("\n") + 1 # offset of column 0 of line + j = string.rfind(upto_open, "\n") + 1 # offset of column 0 of line offset = i - j return "%d.%d" % (lno - lines_back, offset) |