summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2020-04-26 14:30:05 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2020-04-26 15:18:01 +0200
commitbe5a61b13e48a129613e0c659bfd28bf9824f53c (patch)
tree3c54d099aeef110ed7cedbeffd34b7b659b2885d
parent577f260d2a198f58793b137e76c7d7ed28ebc159 (diff)
downloadpylint-git-be5a61b13e48a129613e0c659bfd28bf9824f53c.tar.gz
More localized disable for broad-except in Pylinter
-rw-r--r--pylint/lint/pylinter.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py
index 70c01bc85..eafd7216d 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 @@ class PyLinter(
)
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 @@ class PyLinter(
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