Skip to content

Commit b35fa6b

Browse files
committed
ref: Update mypy
1 parent 31a2ad3 commit b35fa6b

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

sentry_sdk/integrations/flask.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ def raw_data(self):
134134
return self.request.get_data()
135135

136136
def form(self):
137-
# type: () -> ImmutableMultiDict
137+
# type: () -> ImmutableMultiDict[str, Any]
138138
return self.request.form
139139

140140
def files(self):
141-
# type: () -> ImmutableMultiDict
141+
# type: () -> ImmutableMultiDict[str, Any]
142142
return self.request.files
143143

144144
def is_json(self):

sentry_sdk/integrations/redis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ def sentry_patched_execute_command(self, name, *args, **kwargs):
4949
return old_execute_command(self, name, *args, **kwargs)
5050

5151
redis.StrictRedis.execute_command = ( # type: ignore
52-
sentry_patched_execute_command
52+
sentry_patched_execute_command # type: ignore
5353
)

sentry_sdk/utils.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,25 @@ def __init__(self, value):
104104
self.__dict__ = dict(value.__dict__)
105105
return
106106
parts = urlparse.urlsplit(text_type(value))
107+
107108
if parts.scheme not in (u"http", u"https"):
108109
raise BadDsn("Unsupported scheme %r" % parts.scheme)
109110
self.scheme = parts.scheme
111+
112+
if parts.hostname is None:
113+
raise BadDsn("Missing hostname")
114+
110115
self.host = parts.hostname
111-
self.port = parts.port
112-
if self.port is None:
116+
117+
if parts.port is None:
113118
self.port = self.scheme == "https" and 443 or 80
114-
self.public_key = parts.username
115-
if not self.public_key:
119+
else:
120+
self.port = parts.port
121+
122+
if not parts.username:
116123
raise BadDsn("Missing public key")
124+
125+
self.public_key = parts.username
117126
self.secret_key = parts.password
118127

119128
path = parts.path.rsplit("/", 1)

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ deps =
159159
linters: black
160160
linters: flake8
161161
linters: flake8-import-order
162-
linters: mypy==0.730
162+
linters: mypy==0.740
163163
linters: flake8-bugbear>=19.8.0
164164

165165
py3.8: hypothesis

0 commit comments

Comments
 (0)