-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False-negative used-before-assignment
after try-except block
#5524
Comments
Extending this example, if the try block actually defines Maybe try:
a = 1 / n
except LibraryError:
pass
print(a) # [nonexhaustive-error-handling] try:
a = 1 / n
except LibraryError:
pass
else:
print(a) # no message From discussion in #5582 (comment). |
We can close #2835 as a duplicate. |
Another idea. I like how pyright names it. Maybe
We shouldn't really "force" users to add an |
Followup to #5500 (comment)
The code above should raise a
used-before-assignment
error sincemsg
is not assigned in theAttributeError
ExceptHandler.The text was updated successfully, but these errors were encountered: