Patchwork D1538: py3: add b'' to regular expressions which are raw strings

login
register
mail settings
Submitter phabricator
Date Nov. 29, 2017, 1:07 a.m.
Message ID <differential-rev-PHID-DREV-uqgdhvddfwcdhxtutxty-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25792/
State Superseded
Headers show

Comments

phabricator - Nov. 29, 2017, 1:07 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1538

AFFECTED FILES
  hgext/mq.py
  mercurial/util.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2667,7 +2667,7 @@ 
         else:
             prefix_char = prefix
         mapping[prefix_char] = prefix_char
-    r = remod.compile(r'%s(%s)' % (prefix, patterns))
+    r = remod.compile(br'%s(%s)' % (prefix, patterns))
     return r.sub(lambda x: fn(mapping[x.group()[1:]]), s)
 
 def getport(port):
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -565,7 +565,7 @@ 
                 return index
         return None
 
-    guard_re = re.compile(r'\s?#([-+][^-+# \t\r\n\f][^# \t\r\n\f]*)')
+    guard_re = re.compile(br'\s?#([-+][^-+# \t\r\n\f][^# \t\r\n\f]*)')
 
     def parseseries(self):
         self.series = []