File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,8 @@ def __init__(self,
123
123
service_url = None ,
124
124
service_port = None ,
125
125
btc_conf_file = None ,
126
- timeout = DEFAULT_HTTP_TIMEOUT ):
126
+ timeout = DEFAULT_HTTP_TIMEOUT ,
127
+ connection = None ):
127
128
128
129
# Create a dummy connection early on so if __init__() fails prior to
129
130
# __conn being created __del__() can detect the condition and handle it
@@ -204,8 +205,11 @@ def __init__(self,
204
205
authpair = authpair .encode ('utf8' )
205
206
self .__auth_header = b"Basic " + base64 .b64encode (authpair )
206
207
207
- self .__conn = httplib .HTTPConnection (self .__url .hostname , port = port ,
208
- timeout = timeout )
208
+ if connection :
209
+ self .__conn = connection
210
+ else :
211
+ self .__conn = httplib .HTTPConnection (self .__url .hostname , port = port ,
212
+ timeout = timeout )
209
213
210
214
def _call (self , service_name , * args ):
211
215
self .__id_count += 1
You can’t perform that action at this time.
0 commit comments