Skip to content

Commit

Permalink
More localized disable for broad-except in Pylinter
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Apr 26, 2020
1 parent 577f260 commit be5a61b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pylint/lint/pylinter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING

# pylint: disable=broad-except

import collections
import contextlib
import functools
Expand Down Expand Up @@ -1050,7 +1048,7 @@ def get_ast(self, filepath, modname, data=None):
)
except astroid.AstroidBuildingException as ex:
self.add_message("parse-error", args=ex)
except Exception as ex:
except Exception as ex: # pylint: disable=broad-except
traceback.print_exc()
self.add_message("astroid-error", args=(ex.__class__, ex))

Expand Down Expand Up @@ -1161,7 +1159,7 @@ def _report_evaluation(self):
evaluation = self.config.evaluation
try:
note = eval(evaluation, {}, self.stats) # pylint: disable=eval-used
except Exception as ex:
except Exception as ex: # pylint: disable=broad-except
msg = "An exception occurred while rating: %s" % ex
else:
self.stats["global_note"] = note
Expand Down

0 comments on commit be5a61b

Please sign in to comment.