[PATCH 6 of 8 py3] tests: use urlreq in tinyproxy.py

Gregory Szorc gregory.szorc at gmail.com
Wed Mar 22 01:56:43 EDT 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1490161502 25200
#      Tue Mar 21 22:45:02 2017 -0700
# Node ID 13b41c9e0b911c3dc1dfe8ceb319fb28391d31ca
# Parent  89b99d4557cec1e24d0f11426c966bb4e548e1f0
tests: use urlreq in tinyproxy.py

This is our last consumer of util.urlparse.

diff --git a/tests/tinyproxy.py b/tests/tinyproxy.py
--- a/tests/tinyproxy.py
+++ b/tests/tinyproxy.py
@@ -23,8 +23,8 @@ import sys
 from mercurial import util
 
 httpserver = util.httpserver
-urlparse = util.urlparse
 socketserver = util.socketserver
+urlreq = util.urlreq
 
 if os.environ.get('HGIPV6', '0') == '1':
     family = socket.AF_INET6
@@ -85,7 +85,7 @@ class ProxyHandler (httpserver.basehttpr
             self.connection.close()
 
     def do_GET(self):
-        (scm, netloc, path, params, query, fragment) = urlparse.urlparse(
+        (scm, netloc, path, params, query, fragment) = urlreq.urlparse(
             self.path, 'http')
         if scm != 'http' or fragment or not netloc:
             self.send_error(400, "bad url %s" % self.path)
@@ -96,7 +96,7 @@ class ProxyHandler (httpserver.basehttpr
                 self.log_request()
                 soc.send("%s %s %s\r\n" % (
                     self.command,
-                    urlparse.urlunparse(('', '', path, params, query, '')),
+                    urlreq.urlunparse(('', '', path, params, query, '')),
                     self.request_version))
                 self.headers['Connection'] = 'close'
                 del self.headers['Proxy-Connection']


More information about the Mercurial-devel mailing list