changeset 35584:6f62a1c3e11d

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
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 29 Dec 2017 05:28:05 +0530
parents 2f123f309f61
children 35fb3367f72d
files mercurial/byterange.py mercurial/mdiff.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/byterange.py	Fri Dec 29 05:27:00 2017 +0530
+++ b/mercurial/byterange.py	Fri Dec 29 05:28:05 2017 +0530
@@ -416,7 +416,7 @@
     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))
--- a/mercurial/mdiff.py	Fri Dec 29 05:27:00 2017 +0530
+++ b/mercurial/mdiff.py	Fri Dec 29 05:28:05 2017 +0530
@@ -100,7 +100,7 @@
     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):