Use string methods.

This commit is contained in:
Fred Drake 2002-10-16 15:30:17 +00:00
parent 06912b7702
commit 071972e426
7 changed files with 18 additions and 23 deletions

View file

@ -2,7 +2,6 @@
__version__ = '$Revision$'
import os
import string
import sys
@ -10,7 +9,7 @@ import sys
try:
p = os.path.dirname(__file__)
except NameError:
p = sys.path[0]
p = os.path.dirname(sys.argv[0])
p = os.path.normpath(os.path.join(os.getcwd(), p, os.pardir,
"api", "refcounts.dat"))
DEFAULT_PATH = p
@ -27,11 +26,11 @@ def loadfile(fp):
line = fp.readline()
if not line:
break
line = string.strip(line)
line = line.strip()
if line[:1] in ("", "#"):
# blank lines and comments
continue
parts = string.split(line, ":", 4)
parts = line.split(":", 4)
if len(parts) != 5:
raise ValueError("Not enough fields in " + `line`)
function, type, arg, refcount, comment = parts