# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-03-16 23:40:58 # Node ID 492c64afc54c3911df2304dbcf873a5b2b9e205c # Parent 8122cc5cb54328eaa2ca1e769da520979f55b852 py3: make the regular expression bytes to prevent TypeError diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -286,7 +286,7 @@ def aliasargs(fn, givenargs): if num < len(givenargs): return givenargs[num] raise error.Abort(_('too few arguments for command alias')) - cmd = re.sub(r'\$(\d+|\$)', replacer, cmd) + cmd = re.sub(br'\$(\d+|\$)', replacer, cmd) givenargs = [x for i, x in enumerate(givenargs) if i not in nums] args = pycompat.shlexsplit(cmd) diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -408,7 +408,7 @@ def shellquote(s): return '"%s"' % s global _needsshellquote if _needsshellquote is None: - _needsshellquote = re.compile(r'[^a-zA-Z0-9._/+-]').search + _needsshellquote = re.compile(br'[^a-zA-Z0-9._/+-]').search if s and not _needsshellquote(s): # "s" shouldn't have to be quoted return s