summaryrefslogtreecommitdiff
path: root/Tools/scripts/cleanfuture.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 +0000
committerCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 +0000
commit6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch)
treef1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/scripts/cleanfuture.py
parente5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff)
downloadcpython-git-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz
Convert print statements to function calls in Tools/.
Diffstat (limited to 'Tools/scripts/cleanfuture.py')
-rw-r--r--Tools/scripts/cleanfuture.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Tools/scripts/cleanfuture.py b/Tools/scripts/cleanfuture.py
index 6ee93e6ebd..e6c8c8c670 100644
--- a/Tools/scripts/cleanfuture.py
+++ b/Tools/scripts/cleanfuture.py
@@ -78,7 +78,7 @@ def main():
def check(file):
if os.path.isdir(file) and not os.path.islink(file):
if verbose:
- print "listing directory", file
+ print("listing directory", file)
names = os.listdir(file)
for name in names:
fullname = os.path.join(file, name)
@@ -89,7 +89,7 @@ def check(file):
return
if verbose:
- print "checking", file, "...",
+ print("checking", file, "...", end=' ')
try:
f = open(file)
except IOError as msg:
@@ -103,33 +103,33 @@ def check(file):
f.close()
if changed:
if verbose:
- print "changed."
+ print("changed.")
if dryrun:
- print "But this is a dry run, so leaving it alone."
+ print("But this is a dry run, so leaving it alone.")
for s, e, line in changed:
- print "%r lines %d-%d" % (file, s+1, e+1)
+ print("%r lines %d-%d" % (file, s+1, e+1))
for i in range(s, e+1):
- print ff.lines[i],
+ print(ff.lines[i], end=' ')
if line is None:
- print "-- deleted"
+ print("-- deleted")
else:
- print "-- change to:"
- print line,
+ print("-- change to:")
+ print(line, end=' ')
if not dryrun:
bak = file + ".bak"
if os.path.exists(bak):
os.remove(bak)
os.rename(file, bak)
if verbose:
- print "renamed", file, "to", bak
+ print("renamed", file, "to", bak)
g = open(file, "w")
ff.write(g)
g.close()
if verbose:
- print "wrote new", file
+ print("wrote new", file)
else:
if verbose:
- print "unchanged."
+ print("unchanged.")
class FutureFinder: