mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
#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:
parent
20f0fb68aa
commit
5317e9cd8d
2 changed files with 22 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue