Skip to content

Commit 1a5fbb8

Browse files
authored
Catch AttributeError in InfferedValue._safe_infer_internal (#3684)
## Changes Catch `AttributeError` in `InfferedValue._safe_infer_internal` to make the inference safer. It is a bug in Astroid pylint-dev/astroid#2683 ### Linked issues Resolves #3659 ### Functionality - [x] strengthen source code linting code, specifically value inference
1 parent 84d2f11 commit 1a5fbb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/databricks/labs/ucx/source_code/python/python_infer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _infer_values(cls, node: NodeNG) -> Iterator[Iterable[NodeNG]]:
6969
def _safe_infer_internal(cls, node: NodeNG) -> Iterator[Iterable[NodeNG]]:
7070
try:
7171
yield from cls._unsafe_infer_internal(node)
72-
except (InferenceError, KeyError) as e:
72+
except (InferenceError, KeyError, AttributeError) as e:
7373
logger.debug(f"When inferring: {node}", exc_info=e)
7474
yield [Uninferable]
7575

0 commit comments

Comments
 (0)