handle file reading exceptions

This commit is contained in:
Kevin James 2017-08-15 23:03:55 -07:00
parent 31d9774748
commit 38bd34f828
2 changed files with 15 additions and 1 deletions

View file

@ -42,6 +42,12 @@ def check_file_for_debug_statements(filename):
print('\t' + traceback.format_exc().replace('\n', '\n\t'))
print()
return 1
except Exception:
print('{} - Caught exception while reading file'.format(filename))
print()
print('\t' + traceback.format_exc().replace('\n', '\n\t'))
print()
return 1
visitor = ImportStatementParser()
visitor.visit(ast_obj)
if visitor.debug_import_statements: