mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
String method conversion.
This commit is contained in:
parent
be9b507bdd
commit
b08b2d3166
6 changed files with 35 additions and 38 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue