File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1515from sentry_sdk ._compat import reraise
1616from sentry_sdk .integrations import Integration
1717from sentry_sdk .integrations .logging import ignore_logger
18+ from sentry_sdk ._types import MYPY
19+
20+ if MYPY :
21+ from typing import Any
1822
1923
2024CELERY_CONTROL_FLOW_EXCEPTIONS = (Retry , Ignore , Reject )
@@ -156,9 +160,12 @@ def _capture_exception(task, exc_info):
156160 if hasattr (task , "throws" ) and isinstance (exc_info [1 ], task .throws ):
157161 return
158162
163+ # If an integration is there, a client has to be there.
164+ client = hub .client # type: Any
165+
159166 event , hint = event_from_exception (
160167 exc_info ,
161- client_options = hub . client .options ,
168+ client_options = client .options ,
162169 mechanism = {"type" : "celery" , "handled" : False },
163170 )
164171
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ deps =
130130 linters: black
131131 linters: flake8
132132 linters: flake8-import-order
133- linters: mypy
133+ linters: mypy>=0.720
134134
135135 # https://github.com/PyCQA/flake8-bugbear/pull/77
136136 linters: git+https://github.com/untitaker/flake8-bugbear# branch=fix/b901-yield-expr
You can’t perform that action at this time.
0 commit comments