diff --git a/bitcoinrpc/authproxy.py b/bitcoinrpc/authproxy.py index d2ccff3..60d00ef 100644 --- a/bitcoinrpc/authproxy.py +++ b/bitcoinrpc/authproxy.py @@ -38,6 +38,7 @@ import http.client as httplib except ImportError: import httplib +import sys import base64 import json import decimal @@ -89,12 +90,18 @@ def __init__(self, service_url, service_name=None, timeout=HTTP_TIMEOUT, connect # Callables re-use the connection of the original proxy self.__conn = connection elif self.__url.scheme == 'https': - self.__conn = httplib.HTTPSConnection(self.__url.hostname, port, - None, None, False, - timeout) + if sys.version_info < (3, 4): + self.__conn = httplib.HTTPSConnection(self.__url.hostname, port, + None, None, False, timeout) + else: + self.__conn = httplib.HTTPSConnection(self.__url.hostname, port, + None, None, timeout) else: - self.__conn = httplib.HTTPConnection(self.__url.hostname, port, - False, timeout) + if sys.version_info < (3, 4): + self.__conn = httplib.HTTPConnection(self.__url.hostname, port, + False, timeout) + else: + self.__conn = httplib.HTTPConnection(self.__url.hostname, port, timeout) def __getattr__(self, name): if name.startswith('__') and name.endswith('__'):