summaryrefslogtreecommitdiffstats
path: root/Lib/compileall.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-12-16 19:08:51 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-12-16 19:08:51 (GMT)
commit5317e9cd8dc4bf1f02eb9144acb119673d537387 (patch)
tree7b89da90a5d01a62d749b7f976438d14bd762fa6 /Lib/compileall.py
parent20f0fb68aa24876abf768292b33cda138237ff6c (diff)
downloadcpython-5317e9cd8dc4bf1f02eb9144acb119673d537387.zip
cpython-5317e9cd8dc4bf1f02eb9144acb119673d537387.tar.gz
cpython-5317e9cd8dc4bf1f02eb9144acb119673d537387.tar.bz2
#10719: restore messages generated on invalid compileall args
Before the introduction of filename arguments to compileall it gave semi useful messages about not being able to 'list' names that weren't valid directories. This fix restores that behavior. In addition to the test for this case, the patch also adds a test for the default behavior of compileall when no arguments are provided, and fixes a bug in one of the previously added tests.
Diffstat (limited to 'Lib/compileall.py')
-rw-r--r--Lib/compileall.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py
index f1ff5cc..f9ec486 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -207,15 +207,15 @@ def main():
try:
if compile_dests:
for dest in compile_dests:
- if os.path.isdir(dest):
+ if os.path.isfile(dest):
+ if not compile_file(dest, args.ddir, args.force, args.rx,
+ args.quiet, args.legacy):
+ success = False
+ else:
if not compile_dir(dest, args.maxlevels, args.ddir,
args.force, args.rx, args.quiet,
args.legacy):
success = False
- else:
- if not compile_file(dest, args.ddir, args.force, args.rx,
- args.quiet, args.legacy):
- success = False
return success
else:
return compile_path(legacy=args.legacy)