-
Notifications
You must be signed in to change notification settings - Fork 180
regression in 2.0.0: add test for false warning about unused exception when using locals() #333
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
Conversation
This has nothing to do with |
Using locals() is kind of like |
Thanks for clarifying why it has changed.
Can you elaborate why that is the case? Outside of exception handling |
I'm not confident that's accurate, but I'm also not certain that's inaccurate. Can you share your evidence for this assertion? |
@sigmavirus24 I think @dirk-thomas might be referring to this test. pyflakes/pyflakes/test/test_other.py Lines 1178 to 1186 in a13dbe6
|
The approach that I used for The same could be done with Then the report would show which names in the scope are only used by #343 fixes this bug, and provides the basis for reporting unused variables differently if they were only used by |
With the alternative pull request up (though still not being merge) I will close this PR and remove my fork. |
This patch adds a test for a case which worked with the previous release (1.6.0, no warning) but fails with the latest release (2.0.0, false warning about unused
e
).Since I don't know where / when between the releases the behavior regressed I created this test to cover that use case. Once the bug has been fixed the test should pass again.