Patchwork [3,of,8,py3] pycompat: remove urlunquote alias

login
register
mail settings
Submitter Gregory Szorc
Date March 22, 2017, 5:56 a.m.
Message ID <242fec51a193b396f178.1490162200@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/19552/
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 1490160496 25200
#      Tue Mar 21 22:28:16 2017 -0700
# Node ID 242fec51a193b396f1783383d830d97babad9208
# Parent  2a95cd875bfaaec90197a28d33e112ee675066e3
pycompat: remove urlunquote alias

It is duplicated by urlreq.unquote and is unused. Kill it.

We retain the imports because it is re-exported via util.urlparse,
which is used elsewhere.

Since we no longer access attributes of urlparse at module load time,
this change /should/ result in that module reverting to a lazy module.

Patch

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -23,7 +23,6 @@  if not ispy3:
     import Queue as _queue
     import SocketServer as socketserver
     import urlparse
-    urlunquote = urlparse.unquote
     import xmlrpclib
 else:
     import http.client as httplib
@@ -31,7 +30,6 @@  else:
     import queue as _queue
     import socketserver
     import urllib.parse as urlparse
-    urlunquote = urlparse.unquote_to_bytes
     import xmlrpc.client as xmlrpclib
 
 if ispy3: