mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
#2225: return nonzero status code from py_compile if not all files could be compiled.
This commit is contained in:
parent
810ea29b0e
commit
a7bd27f0a8
3 changed files with 15 additions and 3 deletions
|
@ -154,11 +154,15 @@ def main(args=None):
|
|||
"""
|
||||
if args is None:
|
||||
args = sys.argv[1:]
|
||||
rv = 0
|
||||
for filename in args:
|
||||
try:
|
||||
compile(filename, doraise=True)
|
||||
except PyCompileError,err:
|
||||
except PyCompileError, err:
|
||||
# return value to indicate at least one failure
|
||||
rv = 1
|
||||
sys.stderr.write(err.msg)
|
||||
return rv
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
sys.exit(main())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue