-
-
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 positive for catching-non-exception #125
Comments
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): Solved with https://bitbucket.org/logilab/pylint/pull-request/78/fix-false-positive-for-catching-non/diff. Thanks for the report! |
Original comment by BitBucket: benzionhain: Thanks for the quick response and fix. another reason to love pylint :) ben |
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?): Removing version: 1.1 (automated comment) |
@PCManticore There may be a regression here, triggered in https://github.com/GoogleCloudPlatform/gcloud-python To reproduce, install """Bogus docstring."""
from grpc.framework.interfaces.face import face
try:
MY_GLOBAL = 11
except face.NetworkError:
raise ValueError('Other error') then the error is
But note that the MRO contains >>> from grpc.framework.interfaces.face import face
D0718 16:12:55.983836848 26996 ev_posix.c:101] Using polling engine: poll
>>> face.NetworkError.__mro__
(<class 'grpc.framework.interfaces.face.face.NetworkError'>, <class 'grpc.framework.interfaces.face.face.AbortionError'>, <type 'exceptions.Exception'>, <type 'exceptions.BaseException'>, <type 'object'>) It's possible that there is some sort of failure in the static analysis caused by usage of |
@PCManticore You are awesome! |
Originally reported by: Anonymous
when i create a class that inherits from socket.error (which inherits from Exception), and use the new class in a try/except block, i receive a pylint error message stating that i am "catching a exception which doesn't inherit from BaseException: (catching-non-exception)"
eg:
from socket import error
class MyError(error): pass
try:
print 'a'
except MyError:
print 'b'
The text was updated successfully, but these errors were encountered: