summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/reindent.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-04-27 19:48:23 (GMT)
committerGuido van Rossum <guido@python.org>2007-04-27 19:48:23 (GMT)
commit6247fdbf93a8c72e1be40d396102b7f1a1271c95 (patch)
treefe4b056da3bfeaa8bb18fabde659ffda97e1f83a /Tools/scripts/reindent.py
parent4a76da79cd77bd04dacc1a2bfb22f149dcaad33d (diff)
downloadcpython-6247fdbf93a8c72e1be40d396102b7f1a1271c95.zip
cpython-6247fdbf93a8c72e1be40d396102b7f1a1271c95.tar.gz
cpython-6247fdbf93a8c72e1be40d396102b7f1a1271c95.tar.bz2
Fix print syntax so this runs using 3.0.
Diffstat (limited to 'Tools/scripts/reindent.py')
-rw-r--r--Tools/scripts/reindent.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Tools/scripts/reindent.py b/Tools/scripts/reindent.py
index 70242cc..dade071 100644
--- a/Tools/scripts/reindent.py
+++ b/Tools/scripts/reindent.py
@@ -45,8 +45,8 @@ dryrun = 0
def usage(msg=None):
if msg is not None:
- print >> sys.stderr, msg
- print >> sys.stderr, __doc__
+ print(msg, file=sys.stderr)
+ print(__doc__, file=sys.stderr)
def errprint(*args):
sep = ""
@@ -85,7 +85,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)
@@ -96,7 +96,7 @@ def check(file):
return
if verbose:
- print "checking", file, "...",
+ print("checking", file, "...", end=' ')
try:
f = open(file)
except IOError as msg:
@@ -107,24 +107,24 @@ def check(file):
f.close()
if r.run():
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.")
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)
f = open(file, "w")
r.write(f)
f.close()
if verbose:
- print "wrote new", file
+ print("wrote new", file)
else:
if verbose:
- print "unchanged."
+ print("unchanged.")
def _rstrip(line, JUNK='\n \t'):
"""Return line stripped of trailing spaces, tabs, newlines.