Skip to content

Commit 4482db5

Browse files
author
Josh Owen
committed
more efficient error code checking
1 parent c17e86a commit 4482db5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sendgrid/sendgrid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def _raising_send(self, message):
109109
try:
110110
return self._make_request(message)
111111
except HTTPError as e:
112-
if e.code in range(400, 500):
112+
if 400 <= e.code < 500:
113113
raise SendGridClientError(e.code, e.read())
114-
elif e.code in range(500, 600):
114+
elif 500 <= e.code < 600:
115115
raise SendGridServerError(e.code, e.read())
116116
else:
117117
assert False

0 commit comments

Comments
 (0)