# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-12-28 23:58:05 # Node ID 6f62a1c3e11d3cdda882a316751b48e0dda07bc7 # Parent 2f123f309f617ff70a0951a9e2f633dc312db287 py3: make regular expressions bytes by prepending b'' Regexes start with r'' and hence transformer skips adding b'' there. # skip-blame because we are just adding b'' Differential Revision: https://phab.mercurial-scm.org/D1794 diff --git a/mercurial/byterange.py b/mercurial/byterange.py --- a/mercurial/byterange.py +++ b/mercurial/byterange.py @@ -416,7 +416,7 @@ def range_header_to_tuple(range_header): if range_header is None: return None if _rangere is None: - _rangere = re.compile(r'^bytes=(\d{1,})-(\d*)') + _rangere = re.compile(br'^bytes=(\d{1,})-(\d*)') match = _rangere.match(range_header) if match: tup = range_tuple_normalize(match.group(1, 2)) diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -100,7 +100,7 @@ def wsclean(opts, text, blank=True): if blank and opts.ignoreblanklines: text = re.sub('\n+', '\n', text).strip('\n') if opts.ignorewseol: - text = re.sub(r'[ \t\r\f]+\n', r'\n', text) + text = re.sub(br'[ \t\r\f]+\n', r'\n', text) return text def splitblock(base1, lines1, base2, lines2, opts):