mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Use string methods.
This commit is contained in:
parent
06912b7702
commit
071972e426
7 changed files with 18 additions and 23 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue