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

[invalid-class-object] Fix crash when __class__ is defined with a tuple #7473

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Sep 16, 2022

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Closes #7467

@Pierre-Sassoulas Pierre-Sassoulas added Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer Crash πŸ’₯ A bug that makes pylint crash labels Sep 16, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.15.3 milestone Sep 16, 2022
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the fix-invalid-class-object-with-tuple branch from a565d40 to 4530626 Compare September 16, 2022 08:28
@coveralls
Copy link

coveralls commented Sep 16, 2022

Pull Request Test Coverage Report for Build 3067592274

  • 9 of 9 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 95.319%

Totals Coverage Status
Change from base Build 3066552830: 0.002%
Covered Lines: 17044
Relevant Lines: 17881

πŸ’› - Coveralls

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the fix-invalid-class-object-with-tuple branch 2 times, most recently from 2248023 to 8831477 Compare September 16, 2022 08:43
@Pierre-Sassoulas Pierre-Sassoulas changed the title Fix invalid class object with tuple [invalid-class-object] Fix crash when __class__ is defined with a tuple Sep 16, 2022
@Pierre-Sassoulas Pierre-Sassoulas changed the title [invalid-class-object] Fix crash when __class__ is defined with a tuple [invalid-class-object] Fix crash when __class__ is defined with a tuple Sep 16, 2022
@github-actions

This comment has been minimized.

doc/whatsnew/fragments/7467.bugfix Outdated Show resolved Hide resolved
pylint/checkers/classes/class_checker.py Outdated Show resolved Hide resolved
pylint/checkers/classes/class_checker.py Show resolved Hide resolved
@@ -1,2 +1,5 @@
invalid-class-object:17:0:17:11::Invalid __class__ object:UNDEFINED
invalid-class-object:18:0:18:11::Invalid __class__ object:UNDEFINED
invalid-class-object:20:0:20:11::Invalid assignement to '__class__'. Should be a class definition but got a 'Instance':INFERENCE
Copy link
Member

Choose a reason for hiding this comment

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

These have to be updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

🀦

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the fix-invalid-class-object-with-tuple branch from 77f97bd to 98ef493 Compare September 16, 2022 11:44
@github-actions
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 98ef493

@Pierre-Sassoulas Pierre-Sassoulas merged commit b47aa30 into pylint-dev:main Sep 16, 2022
@Pierre-Sassoulas Pierre-Sassoulas deleted the fix-invalid-class-object-with-tuple branch September 16, 2022 14:00
@Pierre-Sassoulas Pierre-Sassoulas added Backported and removed Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer labels Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported Crash πŸ’₯ A bug that makes pylint crash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Even after #7429 merged, a crash AttributeError: 'ClassDef' object has no attribute 'value'
3 participants