We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
UP024
OSError
Found a false positive one:
My code:
import socket ... from kombu import Connection, exceptions ... try: conn = Connection(settings.CELERY_BROKER_URL) conn.ensure_connection(max_retries=2) conn._close() except (socket.error, exceptions.OperationalError): return HttpResponseServerError("cache: cannot connect to broker.")
their MROs:
exceptions.OperationalError.__mro__ (<class 'kombu.exceptions.OperationalError'>, <class 'kombu.exceptions.KombuError'>, <class 'Exception'>, <class 'BaseException'>, <class 'object'>) socket.error.__mro__ (<class 'OSError'>, <class 'Exception'>, <class 'BaseException'>, <class 'object'>)
ruff suggests:
try: conn = Connection(settings.CELERY_BROKER_URL) conn.ensure_connection(max_retries=2) conn._close() except OSError: return HttpResponseServerError("cache: cannot connect to broker.")
Seems like ruff ignores the second one's MRO. Thank you!
Originally posted by @deliro in #1568 (comment)
The text was updated successfully, but these errors were encountered:
charliermarsh
Successfully merging a pull request may close this issue.
Found a false positive one:
My code:
their MROs:
ruff suggests:
Seems like ruff ignores the second one's MRO. Thank you!
Originally posted by @deliro in #1568 (comment)
The text was updated successfully, but these errors were encountered: