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

login
register
mail settings
Submitter Gregory Szorc
Date March 22, 2017, 5:56 a.m.
Message ID <13b41c9e0b911c3dc1df.1490162203@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/19554/
State Accepted
Headers show

Comments

Gregory Szorc - March 22, 2017, 5:56 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

Patch

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']