Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change timeout to opts variable #157

Merged
merged 2 commits into from Jan 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion sendgrid/sendgrid.py
Expand Up @@ -51,6 +51,7 @@ def __init__(self, username_or_apikey, password=None, **opts):
self.endpoint = opts.get('endpoint', '/api/mail.send.json')
self.mail_url = self.host + ':' + self.port + self.endpoint
self._raise_errors = opts.get('raise_errors', False)
self.timeout = opts.get('timeout', 10)
# urllib cannot connect to SSL servers using proxies
self.proxies = opts.get('proxies', None)

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

response = urllib_request.urlopen(req, timeout=10)
response = urllib_request.urlopen(req, timeout = self.timeout)
body = response.read()
return response.getcode(), body

Expand Down