-
Notifications
You must be signed in to change notification settings - Fork 109
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
B904 from None
check gets confused when class defined in except
has a raise
#190
Comments
I'm sure this is a dummy bit of code, but just making sure, please state in the RuntimeError a more descriptive error: RuntimeError("SSL support unavailable with your build of python runtime. Please ensure you've compiled it in.") |
That's the real code, copy pasted 😅 I did notice the message was a bit terse and will fix it. |
I'm glad my dislike for vague error messages will possibly help someone one day understand this more easily! |
In Werkzeug, we want to handle the case where Python was not compiled with SSL, so we
try import ssl
and define a placeholder class inexcept
if the import fails. The class willraise
for any attribute access. B904 gets confused and thinks it should be writtenraise ... from None
even though that doesn't make sense here.Note that I had to add
# noqa: B904
to theraise
line.The text was updated successfully, but these errors were encountered: