summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2019-09-08 08:54:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-09-08 08:54:02 (GMT)
commit9c4c459ac66c86a4511c8fec1997e8760e15ec17 (patch)
treeee24d17491de567b8dc00a78377f6ac8b72bec40
parent32f825393e5836ab71de843596379fa3f9e23c7a (diff)
downloadcpython-9c4c459ac66c86a4511c8fec1997e8760e15ec17.zip
cpython-9c4c459ac66c86a4511c8fec1997e8760e15ec17.tar.gz
cpython-9c4c459ac66c86a4511c8fec1997e8760e15ec17.tar.bz2
bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703)
-rw-r--r--Lib/xmlrpc/client.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index b4b2941..d15d60d 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -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: