Skip to content

Commit 24c084d

Browse files
committed
fix: Update mypy
1 parent 9f9311c commit 24c084d

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

sentry_sdk/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _get_options(*args, **kwargs):
4343
dsn = None
4444

4545
rv = dict(DEFAULT_OPTIONS)
46-
options = dict(*args, **kwargs) # type: ignore
46+
options = dict(*args, **kwargs)
4747
if dsn is not None and options.get("dsn") is None:
4848
options["dsn"] = dsn
4949

sentry_sdk/hub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ def capture_exception(
347347
client = self.client
348348
if client is None:
349349
return None
350-
if error is None:
351-
exc_info = sys.exc_info()
352-
else:
350+
if error is not None:
353351
exc_info = exc_info_from_error(error)
352+
else:
353+
exc_info = sys.exc_info()
354354

355355
event, hint = event_from_exception(exc_info, client_options=client.options)
356356
try:

sentry_sdk/integrations/flask.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ def _request_started(sender, **kwargs):
113113
pass
114114

115115
weak_request = weakref.ref(request)
116-
scope.add_event_processor(
117-
_make_request_event_processor( # type: ignore
118-
app, weak_request, integration
119-
)
116+
evt_processor = _make_request_event_processor(
117+
app, weak_request, integration # type: ignore
120118
)
119+
scope.add_event_processor(evt_processor)
121120

122121

123122
class FlaskRequestExtractor(RequestExtractor):

sentry_sdk/integrations/stdlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _install_subprocess():
150150
def sentry_patched_popen_init(self, *a, **kw):
151151
hub = Hub.current
152152
if hub.get_integration(StdlibIntegration) is None:
153-
return old_popen_init(self, *a, **kw)
153+
return old_popen_init(self, *a, **kw) # type: ignore
154154

155155
# Convert from tuple to list to be able to set values.
156156
a = list(a)
@@ -184,7 +184,7 @@ def sentry_patched_popen_init(self, *a, **kw):
184184
with hub.start_span(op="subprocess", description=description) as span:
185185
span.set_data("subprocess.cwd", cwd)
186186

187-
rv = old_popen_init(self, *a, **kw)
187+
rv = old_popen_init(self, *a, **kw) # type: ignore
188188

189189
span.set_tag("subprocess.pid", self.pid)
190190
return rv

sentry_sdk/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ def walk_exception_chain(exc_info):
482482
while (
483483
exc_type is not None
484484
and exc_value is not None
485+
and tb is not None
485486
and id(exc_value) not in seen_exception_ids
486487
):
487488
yield exc_type, exc_value, tb

sentry_sdk/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _timed_queue_join(self, timeout):
5858
all_tasks_done = None
5959

6060
try:
61-
while queue.unfinished_tasks: # type: ignore
61+
while queue.unfinished_tasks:
6262
delay = deadline - time()
6363
if delay <= 0:
6464
return False

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ deps =
154154
linters: black
155155
linters: flake8
156156
linters: flake8-import-order
157-
linters: mypy>=0.720
157+
linters: mypy>=0.730
158158

159159
# https://github.com/PyCQA/flake8-bugbear/pull/77
160160
linters: git+https://github.com/untitaker/flake8-bugbear#branch=fix/b901-yield-expr

0 commit comments

Comments
 (0)