Skip to content

Commit 7b5cf32

Browse files
Merge branch 'tgehrs-master'
2 parents be7be43 + fa81103 commit 7b5cf32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sendgrid/sendgrid.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self, username_or_apikey, password=None, **opts):
5151
self.endpoint = opts.get('endpoint', '/api/mail.send.json')
5252
self.mail_url = self.host + ':' + self.port + self.endpoint
5353
self._raise_errors = opts.get('raise_errors', False)
54+
self.timeout = opts.get('timeout', 10)
5455
# urllib cannot connect to SSL servers using proxies
5556
self.proxies = opts.get('proxies', None)
5657

@@ -109,7 +110,7 @@ def _make_request(self, message):
109110
# Using API key
110111
req.add_header('Authorization', 'Bearer ' + self.password)
111112

112-
response = urllib_request.urlopen(req, timeout=10)
113+
response = urllib_request.urlopen(req, timeout = self.timeout)
113114
body = response.read()
114115
return response.getcode(), body
115116

0 commit comments

Comments
 (0)