summaryrefslogtreecommitdiff
path: root/pylint/lint
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2022-05-30 15:13:30 -0400
committerJacob Walls <jacobtylerwalls@gmail.com>2022-05-30 16:38:24 -0400
commitd3180eafff77fc6eb56d0418e997cd6e0f31ede8 (patch)
tree99322da211c225449b38c02c907c37eda2fb4790 /pylint/lint
parent896c8ed26bea4e3ecf92f991e2274b93dc2dc74b (diff)
downloadpylint-git-d3180eafff77fc6eb56d0418e997cd6e0f31ede8.tar.gz
Reraise failures in astroid as `AstroidError`
Diffstat (limited to 'pylint/lint')
-rw-r--r--pylint/lint/pylinter.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py
index 0dc9b8c0d..63eb84e10 100644
--- a/pylint/lint/pylinter.py
+++ b/pylint/lint/pylinter.py
@@ -695,6 +695,7 @@ class PyLinter(
:param callable check_astroid_module: callable checking an AST taking the following arguments
- ast: AST of the module
:param FileItem file: data about the file
+ :raises AstroidError: for any failures stemming from astroid
"""
self.set_current_module(file.name, file.filepath)
# get the module representation
@@ -708,7 +709,10 @@ class PyLinter(
# fix the current file (if the source file was not available or
# if it's actually a c extension)
self.current_file = ast_node.file
- check_astroid_module(ast_node)
+ try:
+ check_astroid_module(ast_node)
+ except Exception as e: # pragma: no cover
+ raise astroid.AstroidError from e
# warn about spurious inline messages handling
spurious_messages = self.file_state.iter_spurious_suppression_messages(
self.msgs_store