#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.
This commit is contained in:
R. David Murray 2010-12-16 19:08:51 +00:00
parent 20f0fb68aa
commit 5317e9cd8d
2 changed files with 22 additions and 13 deletions

View file

@ -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)