Submitter | Gregory Szorc |
---|---|
Date | March 22, 2017, 5:56 a.m. |
Message ID | <285f48d5644ea070f717.1490162198@ubuntu-vm-main> |
Download | mbox | patch |
Permalink | /patch/19550/ |
State | Accepted |
Headers | show |
Comments
On Tue, 21 Mar 2017 22:56:38 -0700, Gregory Szorc wrote: > # HG changeset patch > # User Gregory Szorc <gregory.szorc@gmail.com> > # Date 1490160011 25200 > # Tue Mar 21 22:20:11 2017 -0700 > # Node ID 285f48d5644ea070f717473af077e6728df6ea82 > # Parent 102f291807c92864a2231e5e925d6cd64783bb59 > pycompat: alias urlreq.unquote to unquote_to_bytes Queued the series, many thanks.
Patch
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -268,6 +268,10 @@ class _pycompatstub(object): (item.replace(sysstr('_'), sysstr('')).lower(), (origin, item)) for item in items) + def _registeralias(self, origin, attr, name): + """Alias ``origin``.``attr`` as ``name``""" + self._aliases[sysstr(name)] = (origin, sysstr(attr)) + def __getattr__(self, name): try: origin, item = self._aliases[name] @@ -337,8 +341,8 @@ else: "splitpasswd", "splitport", "splituser", - "unquote", )) + urlreq._registeralias(urllib.parse, "unquote_to_bytes", "unquote") import urllib.request urlreq._registeraliases(urllib.request, ( "AbstractHTTPHandler",