Skip to content

Commit 9c4c459

Browse files
corona10serhiy-storchaka
authored andcommitted
bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703)
1 parent 32f8253 commit 9c4c459

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Lib/xmlrpc/client.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,15 +1421,14 @@ def __init__(self, uri, transport=None, encoding=None, verbose=False,
14211421
# establish a "logical" server connection
14221422

14231423
# get the url
1424-
type, uri = urllib.parse._splittype(uri)
1425-
if type not in ("http", "https"):
1424+
p = urllib.parse.urlparse(uri)
1425+
if p.scheme not in ("http", "https"):
14261426
raise OSError("unsupported XML-RPC protocol")
1427-
self.__host, self.__handler = urllib.parse._splithost(uri)
1428-
if not self.__handler:
1429-
self.__handler = "/RPC2"
1427+
self.__host = p.netloc
1428+
self.__handler = p.path or "/RPC2"
14301429

14311430
if transport is None:
1432-
if type == "https":
1431+
if p.scheme == "https":
14331432
handler = SafeTransport
14341433
extra_kwargs = {"context": context}
14351434
else:

0 commit comments

Comments
 (0)