changeset 39431:5bf99c27a7b6

py3: make regexes in hgext/keyword.py bytes # skip-blame because just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D4459
author Pulkit Goyal <pulkit@yandex-team.ru>
date Tue, 04 Sep 2018 17:53:54 +0300
parents c3491d3f8984
children 16c27483f50f
files hgext/keyword.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/keyword.py	Tue Sep 04 17:33:59 2018 +0300
+++ b/hgext/keyword.py	Tue Sep 04 17:53:54 2018 +0300
@@ -208,7 +208,7 @@
 def _shrinktext(text, subfunc):
     '''Helper for keyword expansion removal in text.
     Depending on subfunc also returns number of substitutions.'''
-    return subfunc(r'$\1$', text)
+    return subfunc(br'$\1$', text)
 
 def _preselect(wstatus, changed):
     '''Retrieves modified and added files from a working directory state
@@ -250,12 +250,12 @@
     @util.propertycache
     def rekw(self):
         '''Returns regex for unexpanded keywords.'''
-        return re.compile(r'\$(%s)\$' % self.escape)
+        return re.compile(br'\$(%s)\$' % self.escape)
 
     @util.propertycache
     def rekwexp(self):
         '''Returns regex for expanded keywords.'''
-        return re.compile(r'\$(%s): [^$\n\r]*? \$' % self.escape)
+        return re.compile(br'\$(%s): [^$\n\r]*? \$' % self.escape)
 
     def substitute(self, data, path, ctx, subfunc):
         '''Replaces keywords in data with expanded template.'''