Commit d773e543d8ba2a3e1dadb86630d661eb6e6cdb5b

Authored by Christian Herdtweck
1 parent 9a54b9c9

unify return_code setting

Showing 1 changed file with 4 additions and 2 deletions
oletools/olevba.py
@@ -2988,14 +2988,16 @@ def main(): @@ -2988,14 +2988,16 @@ def main():
2988 print '%-12s %s - File format not supported' % ('?', filename) 2988 print '%-12s %s - File format not supported' % ('?', filename)
2989 else: 2989 else:
2990 log.exception('Failed to open %s -- probably not supported!' % filename) 2990 log.exception('Failed to open %s -- probably not supported!' % filename)
2991 - return_code = RETURN_OPEN_ERROR if return_code == 0 else RETURN_SEVERAL_ERRS 2991 + return_code = RETURN_OPEN_ERROR if return_code == 0 \
  2992 + else RETURN_SEVERAL_ERRS
2992 except ProcessingError as exc: 2993 except ProcessingError as exc:
2993 if options.output_mode in ('triage', 'unspecified'): 2994 if options.output_mode in ('triage', 'unspecified'):
2994 print '%-12s %s - %s' % ('!ERROR', filename, exc.orig_exception) 2995 print '%-12s %s - %s' % ('!ERROR', filename, exc.orig_exception)
2995 else: 2996 else:
2996 log.exception('Error processing file %s (%s)!' 2997 log.exception('Error processing file %s (%s)!'
2997 % (filename, exc.orig_exception)) 2998 % (filename, exc.orig_exception))
2998 - return_code = RETURN_PARSE_ERROR if return_code == 0 else RETURN_SEVERAL_ERRS 2999 + return_code = RETURN_PARSE_ERROR if return_code == 0 \
  3000 + else RETURN_SEVERAL_ERRS
2999 finally: 3001 finally:
3000 vba_parser.close() 3002 vba_parser.close()
3001 3003