]> granicus.if.org Git - python/commitdiff
bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703)
authorDong-hee Na <donghee.na92@gmail.com>
Sun, 8 Sep 2019 08:54:02 +0000 (17:54 +0900)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 8 Sep 2019 08:54:02 +0000 (11:54 +0300)
Lib/xmlrpc/client.py

index b4b2941ea5b407033ad708473e61bc334954bcb2..d15d60d2937a825fa505d3685a2c0171807c8af5 100644 (file)
@@ -1421,15 +1421,14 @@ class ServerProxy:
         # establish a "logical" server connection
 
         # get the url
-        type, uri = urllib.parse._splittype(uri)
-        if type not in ("http", "https"):
+        p = urllib.parse.urlparse(uri)
+        if p.scheme not in ("http", "https"):
             raise OSError("unsupported XML-RPC protocol")
-        self.__host, self.__handler = urllib.parse._splithost(uri)
-        if not self.__handler:
-            self.__handler = "/RPC2"
+        self.__host = p.netloc
+        self.__handler = p.path or "/RPC2"
 
         if transport is None:
-            if type == "https":
+            if p.scheme == "https":
                 handler = SafeTransport
                 extra_kwargs = {"context": context}
             else: