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

Fix detecting invalid metaclasses #1836

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Oct 16, 2022

Description

Noticed two failing pylint tests (invalid_metaclass and dataclass_typecheck) with astroid main. Bisects to #1678.
The change hasn't been released yet, so there is no need to backport the fix.

/CC: @DanielNoord

Type of Changes

Type
🐛 Bug fix

@cdce8p cdce8p added this to the 2.13.0 milestone Oct 16, 2022
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3261116685

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.271%

Totals Coverage Status
Change from base Build 3256664109: 0.0%
Covered Lines: 9861
Relevant Lines: 10687

💛 - Coveralls

@@ -2841,7 +2841,7 @@ def declared_metaclass(
return next(
node
for node in self._metaclass.infer(context=context)
if isinstance(node, NodeNG)
if node is not util.Uninferable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What values were being rejected by the previous check?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, never mind: Instance.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Pierre-Sassoulas Pierre-Sassoulas merged commit 85fe271 into pylint-dev:main Oct 17, 2022
@cdce8p cdce8p deleted the fix-invalid-metaclass branch October 17, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants