From a46eb644a6bc0daaef03c1f2e29cc6c557ede62c Mon Sep 17 00:00:00 2001 From: Steven Myint Date: Thu, 12 Oct 2017 06:49:27 -0700 Subject: [PATCH] Return non-zero exit status for missing files --- autoflake.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoflake.py b/autoflake.py index 46d7a88..2d1086d 100755 --- a/autoflake.py +++ b/autoflake.py @@ -43,7 +43,7 @@ import pyflakes.reporter -__version__ = '0.7' +__version__ = '1.0a0' ATOMS = frozenset([tokenize.NAME, tokenize.NUMBER, tokenize.STRING]) @@ -717,11 +717,15 @@ def _main(argv, standard_out, standard_error): args.exclude = set([]) filenames = list(set(args.files)) + failure = False for name in find_files(filenames, args.recursive, args.exclude): try: fix_file(name, args=args, standard_out=standard_out) except IOError as exception: print(unicode(exception), file=standard_error) + failure = True + + return 1 if failure else 0 def main():