used-before-assignment
false positive with nonlocal
#5965
Labels
C: used-before-assignment
Issues related to 'used-before-assignment' check
False Positive 🦟
A message is emitted but nothing is wrong with the code
Regression
Milestone
Bug description
Getting a false positive for
used-before-assignment
in the latest pylint release when the variable is declared nonlocal. I don't think the new try/except logic is handling it correctly, I believe the code below is valid.Configuration
No response
Command used
Pylint output
test.py:7:23: E0601: Using variable 'myvar' before assignment (used-before-assignment)
Expected behavior
No pylint errors raised
Pylint version
OS / Environment
Ubuntu 18.04
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: