make import urlparse module consistent,httplib update to py3

This commit is contained in:
mdr0id 2019-12-06 21:26:01 -08:00
parent a9aa622359
commit 623f3eb9da
2 changed files with 5 additions and 12 deletions

View File

@ -15,15 +15,8 @@ from test_framework.util import (
) )
import base64 import base64
import os import os
import httplib
try: import urlparse
import http.client as httplib
except ImportError:
import httplib
try:
import urllib.parse as urlparse
except ImportError:
import urlparse
class HTTPBasicsTest (BitcoinTestFramework): class HTTPBasicsTest (BitcoinTestFramework):
def setup_nodes(self): def setup_nodes(self):

View File

@ -33,12 +33,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
""" """
import http.client as httplib import httplib
import base64 import base64
import decimal import decimal
import json import json
import logging import logging
import urllib.parse import urlparse
USER_AGENT = "AuthServiceProxy/0.1" USER_AGENT = "AuthServiceProxy/0.1"
@ -63,7 +63,7 @@ class AuthServiceProxy():
def __init__(self, service_url, service_name=None, timeout=HTTP_TIMEOUT, connection=None): def __init__(self, service_url, service_name=None, timeout=HTTP_TIMEOUT, connection=None):
self.__service_url = service_url self.__service_url = service_url
self.__service_name = service_name self.__service_name = service_name
self.__url = urllib.parse.urlparse(service_url) self.__url = urlparse.urlparse(service_url)
if self.__url.port is None: if self.__url.port is None:
port = 80 port = 80
else: else: