From e3b2213fe131aa7791850738b6bc6358d02de5d7 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Tue, 11 Feb 2020 00:33:29 +0200 Subject: [PATCH] Replace deprecated urllib.parse.splittype and splithost with urlparse. --- basicswap/rpc.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/basicswap/rpc.py b/basicswap/rpc.py index e9843af..796a526 100644 --- a/basicswap/rpc.py +++ b/basicswap/rpc.py @@ -37,10 +37,11 @@ class Jsonrpc(): # establish a "logical" server connection # get the url - type, uri = urllib.parse.splittype(uri) - if type not in ("http", "https"): + parsed = urllib.parse.urlparse(uri) + if parsed.scheme not in ("http", "https"): 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: self.__handler = "/RPC2"