Skip to content

Commit

Permalink
Add timeout class attribute to CreateSendBase which is passed through…
Browse files Browse the repository at this point in the history
… as the timeout paramater to HTTPSConnection.
  • Loading branch information
tysonclugg authored and katharosada committed Apr 10, 2018
1 parent 9fdcb0b commit 18acc1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/createsend/createsend.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import base64
import gzip
import os
import socket
import json
from six import BytesIO
from six.moves.urllib.parse import parse_qs, urlencode, urlparse
Expand Down Expand Up @@ -60,6 +61,7 @@ class ExpiredOAuthToken(Unauthorized):

class CreateSendBase(object):
auth_details = None
timeout = socket._GLOBAL_DEFAULT_TIMEOUT # passed to VerifiedHTTPSConnection

def __init__(self, auth):
self.fake_web = False
Expand Down Expand Up @@ -201,7 +203,7 @@ def same_bodies(body_a, body_b):
self.faker and self.faker.status) else 200
return self.handle_response(status, data)

c = VerifiedHTTPSConnection(parsed_base_uri.netloc)
c = VerifiedHTTPSConnection(parsed_base_uri.netloc, timeout=self.timeout)
c.request(method, self.build_url(
parsed_base_uri, path, params), body, headers)
response = c.getresponse()
Expand Down

0 comments on commit 18acc1b

Please sign in to comment.