From be5a61b13e48a129613e0c659bfd28bf9824f53c Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 26 Apr 2020 14:30:05 +0200 Subject: [PATCH] More localized disable for broad-except in Pylinter --- pylint/lint/pylinter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 70c01bc854..eafd7216d8 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -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 @@ -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)) @@ -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