mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-06 02:38:11 +01:00
Replace deprecated urllib.parse.splittype and splithost with urlparse.
This commit is contained in:
@@ -37,10 +37,11 @@ class Jsonrpc():
|
|||||||
# establish a "logical" server connection
|
# establish a "logical" server connection
|
||||||
|
|
||||||
# get the url
|
# get the url
|
||||||
type, uri = urllib.parse.splittype(uri)
|
parsed = urllib.parse.urlparse(uri)
|
||||||
if type not in ("http", "https"):
|
if parsed.scheme not in ("http", "https"):
|
||||||
raise OSError("unsupported XML-RPC protocol")
|
raise OSError("unsupported XML-RPC protocol")
|
||||||
self.__host, self.__handler = urllib.parse.splithost(uri)
|
self.__host = parsed.netloc
|
||||||
|
self.__handler = parsed.path
|
||||||
if not self.__handler:
|
if not self.__handler:
|
||||||
self.__handler = "/RPC2"
|
self.__handler = "/RPC2"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user