From 6d3e6a924253f2a033823d2b835450f0d904230a Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sun, 18 Feb 2024 14:56:09 -0500 Subject: [PATCH] AstroidBuildingException -> AstroidBuildingError Refs pylint-dev/astroid#2384 --- pylint/checkers/variables.py | 4 ++-- pylint/pyreverse/inspector.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index 8dcaf2cc02..bc20d1987e 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -141,7 +141,7 @@ def _is_from_future_import(stmt: nodes.ImportFrom, name: str) -> bool | None: """Check if the name is a future import from another module.""" try: module = stmt.do_import_module(stmt.modname) - except astroid.AstroidBuildingException: + except astroid.AstroidBuildingError: return None for local_node in module.locals.get(name, []): @@ -2059,7 +2059,7 @@ def visit_importfrom(self, node: nodes.ImportFrom) -> None: name_parts = node.modname.split(".") try: module = node.do_import_module(name_parts[0]) - except astroid.AstroidBuildingException: + except astroid.AstroidBuildingError: return module = self._check_module_attrs(node, module, name_parts[1:]) if not module: diff --git a/pylint/pyreverse/inspector.py b/pylint/pyreverse/inspector.py index 0295c956d0..23ccfa6f30 100644 --- a/pylint/pyreverse/inspector.py +++ b/pylint/pyreverse/inspector.py @@ -35,7 +35,7 @@ def _astroid_wrapper( print(f"parsing {modname}...") try: return func(modname) - except astroid.exceptions.AstroidBuildingException as exc: + except astroid.exceptions.AstroidBuildingError as exc: print(exc) except Exception: # pylint: disable=broad-except traceback.print_exc()