]> granicus.if.org Git - python/commitdiff
Don't use 1.6-isms (s.startswith()) -- we want to distribute this
authorGuido van Rossum <guido@python.org>
Mon, 6 Mar 2000 14:16:41 +0000 (14:16 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 6 Mar 2000 14:16:41 +0000 (14:16 +0000)
before 1.6 is out so it has to be compatible with 1.5.2.

Tools/idle/IdleConf.py
Tools/idle/ParenMatch.py

index 4d6ca4d68e5414c448bc04967c1967696eca913c..df5d9f83116dbb890f8c94876a88a51b12b1f408 100644 (file)
@@ -91,10 +91,10 @@ def load(dir):
     global _dir
     _dir = dir
 
-    if sys.platform.startswith('win'):
+    if sys.platform[:3] == 'win':
         genplatfile = os.path.join(dir, "config-win.txt")
     # XXX don't know what the platform string is on a Mac
-    elif sys.platform.startswith('mac'):
+    elif sys.platform[:3] == 'mac':
         genplatfile = os.path.join(dir, "config-mac.txt")
     else:
         genplatfile = os.path.join(dir, "config-unix.txt")
index d8482b9f4578611f584e463cf0ed3a7383b1850c..9f9e2ea06b4d1f75f340dd1a95798718b1a61b64 100644 (file)
@@ -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)