summaryrefslogtreecommitdiffstats
path: root/Lib/compileall.py
diff options
context:
space:
mode:
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