Skip to content

Fix #5586: False positive for used-before-assignment with homonyms in filtered comprehensions and except blocks #5666

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

Merged

Conversation

jacobtylerwalls
Copy link
Member

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Closes #5586

With a small adjustment, @DanielNoord's suggestion in #5586 (comment) passes the suite, so I just opened a PR. I'm not certain this is the best way to do this, but I tried an alternative diff in get_next_to_consume(), and it turned out to be more questionable.

@DanielNoord
Copy link
Collaborator

Thanks for picking this up immediately @jacobtylerwalls!

Not 100% about the place as well, but since this is what was making the method exit early this seem to be okay!

@DanielNoord DanielNoord added this to the 2.13.0 milestone Jan 11, 2022
@DanielNoord DanielNoord added the False Positive 🦟 A message is emitted but nothing is wrong with the code label Jan 11, 2022
@coveralls
Copy link

coveralls commented Jan 11, 2022

Pull Request Test Coverage Report for Build 1688103945

  • 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 93.752%

Totals Coverage Status
Change from base Build 1684936041: 0.0%
Covered Lines: 14481
Relevant Lines: 15446

πŸ’› - Coveralls

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.

πŸ‘

Co-authored-by: Pierre Sassoulas <[email protected]>
@Pierre-Sassoulas Pierre-Sassoulas merged commit af974aa into pylint-dev:main Jan 12, 2022
@jacobtylerwalls jacobtylerwalls deleted the filtered-comprehension branch January 12, 2022 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive used-before-assignment for filtered comprehensions in try blocks
4 participants