mercurial/byterange.py
changeset 34466 1232f7fa00c3
parent 34371 635553ca6eb9
child 35584 6f62a1c3e11d
--- a/mercurial/byterange.py	Sun Oct 01 10:45:03 2017 -0400
+++ b/mercurial/byterange.py	Sun Oct 01 12:14:21 2017 -0400
@@ -28,6 +28,7 @@
 import stat
 
 from . import (
+    urllibcompat,
     util,
 )
 
@@ -214,8 +215,8 @@
     server would.
     """
     def open_local_file(self, req):
-        host = req.get_host()
-        file = req.get_selector()
+        host = urllibcompat.gethost(req)
+        file = urllibcompat.getselector(req)
         localfile = urlreq.url2pathname(file)
         stats = os.stat(localfile)
         size = stats[stat.ST_SIZE]
@@ -252,7 +253,7 @@
 
 class FTPRangeHandler(urlreq.ftphandler):
     def ftp_open(self, req):
-        host = req.get_host()
+        host = urllibcompat.gethost(req)
         if not host:
             raise IOError('ftp error', 'no host given')
         host, port = splitport(host)