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 15
15
from sentry_sdk ._compat import reraise
16
16
from sentry_sdk .integrations import Integration
17
17
from sentry_sdk .integrations .logging import ignore_logger
18
+ from sentry_sdk ._types import MYPY
19
+
20
+ if MYPY :
21
+ from typing import Any
18
22
19
23
20
24
CELERY_CONTROL_FLOW_EXCEPTIONS = (Retry , Ignore , Reject )
@@ -156,9 +160,12 @@ def _capture_exception(task, exc_info):
156
160
if hasattr (task , "throws" ) and isinstance (exc_info [1 ], task .throws ):
157
161
return
158
162
163
+ # If an integration is there, a client has to be there.
164
+ client = hub .client # type: Any
165
+
159
166
event , hint = event_from_exception (
160
167
exc_info ,
161
- client_options = hub . client .options ,
168
+ client_options = client .options ,
162
169
mechanism = {"type" : "celery" , "handled" : False },
163
170
)
164
171
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ deps =
130
130
linters: black
131
131
linters: flake8
132
132
linters: flake8-import-order
133
- linters: mypy
133
+ linters: mypy>=0.720
134
134
135
135
# https://github.com/PyCQA/flake8-bugbear/pull/77
136
136
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