changeset 36305:a8bca9d0cea0

py3: make sure regex is bytes in crecord.py # skip-blame because we are just adding b'' Differential Revision: https://phab.mercurial-scm.org/D2336
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 19 Feb 2018 00:15:50 +0530
parents 6d6bc544467a
children 3496bffe266d
files mercurial/crecord.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/crecord.py	Mon Feb 19 00:14:33 2018 +0530
+++ b/mercurial/crecord.py	Mon Feb 19 00:15:50 2018 +0530
@@ -950,7 +950,7 @@
         # preprocess the text, converting tabs to spaces
         text = text.expandtabs(4)
         # strip \n, and convert control characters to ^[char] representation
-        text = re.sub(r'[\x00-\x08\x0a-\x1f]',
+        text = re.sub(br'[\x00-\x08\x0a-\x1f]',
                 lambda m:'^' + chr(ord(m.group()) + 64), text.strip('\n'))
 
         if pair is not None: