Skip to content

Commit

Permalink
Simplification in error handling inside Pylinter (#4834)
Browse files Browse the repository at this point in the history
Following review see #4810
  • Loading branch information
Pierre-Sassoulas committed Aug 12, 2021
1 parent 0b34b5f commit 4f57320
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pylint/lint/pylinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,19 +1020,16 @@ def _check_files(self, get_ast, file_descrs):
"""
with self._astroid_module_checker() as check_astroid_module:
for name, filepath, modname in file_descrs:
error = None
try:
self._check_file(
get_ast, check_astroid_module, name, filepath, modname
)
except Exception as ex: # pylint: disable=broad-except
error = ex
template_path = prepare_crash_report(
error, filepath, self.crash_file_path
ex, filepath, self.crash_file_path
)
if error is not None:
msg = get_fatal_error_message(filepath, template_path)
if isinstance(error, AstroidError):
if isinstance(ex, AstroidError):
symbol = "astroid-error"
msg = (filepath, msg)
else:
Expand Down

0 comments on commit 4f57320

Please sign in to comment.