Skip to content

Commit 855c354

Browse files
committed
fix with safe_infer :)
1 parent a73b51f commit 855c354

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pylint/checkers/utils.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1174,10 +1174,8 @@ def class_is_abstract(node: nodes.ClassDef) -> bool:
11741174

11751175
# As well as directly inherited ABC class
11761176
for base in node.bases:
1177-
base_class_name = (
1178-
base.attrname if isinstance(base, astroid.Attribute) else base.as_string()
1179-
)
1180-
if base_class_name == "ABC":
1177+
inferred_base = safe_infer(base)
1178+
if inferred_base.name == "abc" and inferred_base.root().name == "ABC":
11811179
# abc.ABC inheritance
11821180
return True
11831181

0 commit comments

Comments
 (0)