]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merge Py Idle changes:
authorKurt B. Kaiser <kbk@shore.net>
Tue, 17 Sep 2002 03:43:38 +0000 (03:43 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Tue, 17 Sep 2002 03:43:38 +0000 (03:43 +0000)
Rev 1.6 doerwalter
(string methods)

Lib/idlelib/ParenMatch.py

index db6fb6c8007149744b4935ac013993eb2277c661..678d1fd80de7e4dbd58b3cc77541bc2bf4505232 100644 (file)
@@ -10,8 +10,6 @@ We'll have to fix IDLE to do something reasonable when two or more
 extensions what to capture the same event.
 """
 
-import string
-
 import PyParse
 from AutoIndent import AutoIndent, index2line
 from configHandler import idleConf
@@ -166,10 +164,10 @@ class LastOpenBracketFinder:
         if i is None \
            or keysym_type(buf[i]) != right_keysym_type:
             return None
-        lines_back = string.count(buf[i:], "\n") - 1
+        lines_back = buf[i:].count("\n") - 1
         # subtract one for the "\n" added to please the parser
         upto_open = buf[:i]
-        j = string.rfind(upto_open, "\n") + 1 # offset of column 0 of line
+        j = upto_open.rfind("\n") + 1 # offset of column 0 of line
         offset = i - j
         return "%d.%d" % (lno - lines_back, offset)