diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 11:10:16 (GMT) |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 11:10:16 (GMT) |
commit | b08b2d316653bf22d39ad76814b5a0e7dad30c31 (patch) | |
tree | 004b23a8a68e8fa951c21aca3da4e71304fafb48 /Lib/token.py | |
parent | be9b507bddf79fc98536dee2feaf05fcd4438196 (diff) | |
download | cpython-b08b2d316653bf22d39ad76814b5a0e7dad30c31.zip cpython-b08b2d316653bf22d39ad76814b5a0e7dad30c31.tar.gz cpython-b08b2d316653bf22d39ad76814b5a0e7dad30c31.tar.bz2 |
String method conversion.
Diffstat (limited to 'Lib/token.py')
-rwxr-xr-x | Lib/token.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/token.py b/Lib/token.py index 14f56d0..80dc032 100755 --- a/Lib/token.py +++ b/Lib/token.py @@ -94,7 +94,7 @@ def main(): except IOError, err: sys.stdout.write("I/O error: %s\n" % str(err)) sys.exit(1) - lines = string.splitfields(fp.read(), "\n") + lines = fp.read().split("\n") fp.close() prog = re.compile( "#define[ \t][ \t]*([A-Z][A-Z_]*)[ \t][ \t]*([0-9][0-9]*)", @@ -114,7 +114,7 @@ def main(): except IOError, err: sys.stderr.write("I/O error: %s\n" % str(err)) sys.exit(2) - format = string.splitfields(fp.read(), "\n") + format = fp.read().split("\n") fp.close() try: start = format.index("#--start constants--") + 1 @@ -131,7 +131,7 @@ def main(): except IOError, err: sys.stderr.write("I/O error: %s\n" % str(err)) sys.exit(4) - fp.write(string.joinfields(format, "\n")) + fp.write("\n".join(format)) fp.close() |