mirror of
https://github.com/basicswap/basicswap.git
synced 2024-11-17 08:18:04 +00:00
Replace deprecated urllib.parse.splittype and splithost with urlparse.
This commit is contained in:
parent
e293987fa8
commit
e3b2213fe1
1 changed files with 4 additions and 3 deletions
|
@ -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"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue