summaryrefslogtreecommitdiffstats
path: root/Lib/compileall.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/compileall.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/compileall.py')
-rw-r--r--Lib/compileall.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 1e5c6a6..6781908 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -33,11 +33,11 @@ def compile_dir(dir, maxlevels=10, ddir=None,
"""
if not quiet:
- print 'Listing', dir, '...'
+ print('Listing', dir, '...')
try:
names = os.listdir(dir)
except os.error:
- print "Can't list", dir
+ print("Can't list", dir)
names = []
names.sort()
success = 1
@@ -60,18 +60,18 @@ def compile_dir(dir, maxlevels=10, ddir=None,
except os.error: ctime = 0
if (ctime > ftime) and not force: continue
if not quiet:
- print 'Compiling', fullname, '...'
+ print('Compiling', fullname, '...')
try:
ok = py_compile.compile(fullname, None, dfile, True)
except KeyboardInterrupt:
raise KeyboardInterrupt
except py_compile.PyCompileError as err:
if quiet:
- print 'Compiling', fullname, '...'
- print err.msg
+ print('Compiling', fullname, '...')
+ print(err.msg)
success = 0
except IOError as e:
- print "Sorry", e
+ print("Sorry", e)
success = 0
else:
if ok == 0:
@@ -98,7 +98,7 @@ def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0):
success = 1
for dir in sys.path:
if (not dir or dir == os.curdir) and skip_curdir:
- print 'Skipping current directory'
+ print('Skipping current directory')
else:
success = success and compile_dir(dir, maxlevels, None,
force, quiet=quiet)
@@ -110,16 +110,16 @@ def main():
try:
opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:')
except getopt.error as msg:
- print msg
- print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \
- "[-x regexp] [directory ...]"
- print "-l: don't recurse down"
- print "-f: force rebuild even if timestamps are up-to-date"
- print "-q: quiet operation"
- print "-d destdir: purported directory name for error messages"
- print " if no directory arguments, -l sys.path is assumed"
- print "-x regexp: skip files matching the regular expression regexp"
- print " the regexp is search for in the full path of the file"
+ print(msg)
+ print("usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \
+ "[-x regexp] [directory ...]")
+ print("-l: don't recurse down")
+ print("-f: force rebuild even if timestamps are up-to-date")
+ print("-q: quiet operation")
+ print("-d destdir: purported directory name for error messages")
+ print(" if no directory arguments, -l sys.path is assumed")
+ print("-x regexp: skip files matching the regular expression regexp")
+ print(" the regexp is search for in the full path of the file")
sys.exit(2)
maxlevels = 10
ddir = None
@@ -136,7 +136,7 @@ def main():
rx = re.compile(a)
if ddir:
if len(args) != 1:
- print "-d destdir require exactly one directory argument"
+ print("-d destdir require exactly one directory argument")
sys.exit(2)
success = 1
try:
@@ -148,7 +148,7 @@ def main():
else:
success = compile_path()
except KeyboardInterrupt:
- print "\n[interrupt]"
+ print("\n[interrupt]")
success = 0
return success