Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mdiff.py @ 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 | 079b27b5a869 |
line wrap: on
line diff
--- 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):