-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pylint doesn't understand the scope of except clause variables #626
Comments
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?): The scope of 'e' is actually not limited to the except clause (try running your code, it's perfectly fine). Though pylint should issue 'used-before-assignment' because there will be a bug in case where the exception isn't raised. |
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?): Oh right, I missed that part from https://www.python.org/dev/peps/pep-3110/ |
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): This should definitely be fixed. |
* Fix false negative for used-before-assignment (ExceptHandler) Closes #626. * Fix unused-variable check for exception variables
Originally reported by: Tom Dryer (BitBucket: tdryer, GitHub: @tdryer?)
In the following code, pylint fails to identify that the
e
in the except clause is an unused variable, and that thee
inprint(e)
is an undefined variable:The issue appears to be that pylint doesn't understand that the scope of the exception variable is limited to the except clause.
The text was updated successfully, but these errors were encountered: