Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch MRO error when applying missing hints feature. #4688

Merged
merged 8 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -508,3 +508,5 @@ contributors:

* Maksym Humetskyi (mhumetskyi): contributor
- Fixed ignored empty functions by similarities checker with "ignore-signatures" option enabled

* Daniel Dorani (doranid): contributor
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Release date: TBA
..
Put bug fixes that should not wait for a new minor version here

* Fix hard failure when handling missing attribute in a class with duplicated bases

Closes #4687

* Fix false-positive ``consider-using-with`` (R1732) if a ternary conditional is used together with ``with``

Closes #4676
Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _(node):

try:
mro = node.mro()[1:]
except (NotImplementedError, TypeError):
except (NotImplementedError, TypeError, astroid.MroError):
mro = node.ancestors()

other_values = [value for cls in mro for value in _node_names(cls)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pylint: disable=missing-docstring, pointless-statement, useless-object-inheritance
# pylint: disable=duplicate-bases, too-few-public-methods


class Klass(object, object):
def get(self):
self._non_existent_attribute # [no-member]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
no-member:7:8:Klass.get:Instance of 'Klass' has no '_non_existent_attribute' member:INFERENCE