diff --git a/ChangeLog b/ChangeLog index fd6141047c..eaf3fb6d11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,6 +61,8 @@ Release date: Undefined Closes #3850 +* Don't show ``DuplicateBasesError`` for attribute access + What's New in Pylint 2.7.4? =========================== diff --git a/pylint/checkers/typecheck.py b/pylint/checkers/typecheck.py index 2da7c61511..e08cf15b7f 100644 --- a/pylint/checkers/typecheck.py +++ b/pylint/checkers/typecheck.py @@ -985,6 +985,8 @@ def visit_attribute(self, node): continue except AttributeError: continue + except astroid.DuplicateBasesError: + continue except astroid.NotFoundError: # This can't be moved before the actual .getattr call, # because there can be more values inferred and we are diff --git a/tests/functional/d/duplicate_bases.py b/tests/functional/d/duplicate_bases.py index 974f975841..51b329a4fb 100644 --- a/tests/functional/d/duplicate_bases.py +++ b/tests/functional/d/duplicate_bases.py @@ -2,7 +2,7 @@ # pylint: disable=missing-docstring,too-few-public-methods,no-init -class Duplicates(str, str): # [duplicate-bases] +class Duplicates(str, str): # [duplicate-bases] pass @@ -13,3 +13,6 @@ class Alpha(str): class NotDuplicates(Alpha, str): """The error should not be emitted for this case, since the other same base comes from the ancestors.""" + + +print(Duplicates.__mro__)