summaryrefslogtreecommitdiffstats
path: root/Doc/tools/refcounts.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-10-16 15:30:17 (GMT)
committerFred Drake <fdrake@acm.org>2002-10-16 15:30:17 (GMT)
commit071972e426c9782611bd5b66f036d35d809f7ee4 (patch)
treeec6f4f3a441a7365759dd13566c334b3d03ad97f /Doc/tools/refcounts.py
parent06912b7702e46a1a31749b31911be4d44ccbdf27 (diff)
downloadcpython-071972e426c9782611bd5b66f036d35d809f7ee4.zip
cpython-071972e426c9782611bd5b66f036d35d809f7ee4.tar.gz
cpython-071972e426c9782611bd5b66f036d35d809f7ee4.tar.bz2
Use string methods.
Diffstat (limited to 'Doc/tools/refcounts.py')
-rw-r--r--Doc/tools/refcounts.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Doc/tools/refcounts.py b/Doc/tools/refcounts.py
index d7c761b..d82def7 100644
--- a/Doc/tools/refcounts.py
+++ b/Doc/tools/refcounts.py
@@ -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