Merge #7751: test_framework: python3.4 authproxy compat
e7e48ba
test_framework: Py3.4 compat: Specify timeout parameter by name (Luke Dashjr)d7b80b5
test_framework: Avoid infinite loop in encoding Decimal (Wladimir J. van der Laan)
This commit is contained in:
commit
84370d58ff
|
@ -61,7 +61,7 @@ class JSONRPCException(Exception):
|
||||||
|
|
||||||
def EncodeDecimal(o):
|
def EncodeDecimal(o):
|
||||||
if isinstance(o, decimal.Decimal):
|
if isinstance(o, decimal.Decimal):
|
||||||
return round(o, 8)
|
return str(o)
|
||||||
raise TypeError(repr(o) + " is not JSON serializable")
|
raise TypeError(repr(o) + " is not JSON serializable")
|
||||||
|
|
||||||
class AuthServiceProxy(object):
|
class AuthServiceProxy(object):
|
||||||
|
@ -92,11 +92,10 @@ class AuthServiceProxy(object):
|
||||||
self.__conn = connection
|
self.__conn = connection
|
||||||
elif self.__url.scheme == 'https':
|
elif self.__url.scheme == 'https':
|
||||||
self.__conn = httplib.HTTPSConnection(self.__url.hostname, port,
|
self.__conn = httplib.HTTPSConnection(self.__url.hostname, port,
|
||||||
None, None, False,
|
timeout=timeout)
|
||||||
timeout)
|
|
||||||
else:
|
else:
|
||||||
self.__conn = httplib.HTTPConnection(self.__url.hostname, port,
|
self.__conn = httplib.HTTPConnection(self.__url.hostname, port,
|
||||||
False, timeout)
|
timeout=timeout)
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if name.startswith('__') and name.endswith('__'):
|
if name.startswith('__') and name.endswith('__'):
|
||||||
|
|
Loading…
Reference in New Issue