changeset 33096:d9962854a4a2

py3: add b'' to make the regex pattern bytes
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 25 Jun 2017 03:11:55 +0530
parents 9fc880dff5f3
children fce4ed2912bb
files mercurial/patch.py mercurial/ui.py mercurial/util.py
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Mon Jun 26 17:20:46 2017 +0530
+++ b/mercurial/patch.py	Sun Jun 25 03:11:55 2017 +0530
@@ -2735,10 +2735,10 @@
         if line and line[-1] in '+-':
             name, graph = line.rsplit(' ', 1)
             yield (name + ' ', '')
-            m = re.search(r'\++', graph)
+            m = re.search(br'\++', graph)
             if m:
                 yield (m.group(0), 'diffstat.inserted')
-            m = re.search(r'-+', graph)
+            m = re.search(br'-+', graph)
             if m:
                 yield (m.group(0), 'diffstat.deleted')
         else:
--- a/mercurial/ui.py	Mon Jun 26 17:20:46 2017 +0530
+++ b/mercurial/ui.py	Sun Jun 25 03:11:55 2017 +0530
@@ -1257,7 +1257,7 @@
         # prompt to start parsing. Sadly, we also can't rely on
         # choices containing spaces, ASCII, or basically anything
         # except an ampersand followed by a character.
-        m = re.match(r'(?s)(.+?)\$\$([^\$]*&[^ \$].*)', prompt)
+        m = re.match(br'(?s)(.+?)\$\$([^\$]*&[^ \$].*)', prompt)
         msg = m.group(1)
         choices = [p.strip(' ') for p in m.group(2).split('$$')]
         return (msg,
--- a/mercurial/util.py	Mon Jun 26 17:20:46 2017 +0530
+++ b/mercurial/util.py	Sun Jun 25 03:11:55 2017 +0530
@@ -2840,7 +2840,7 @@
             return True # remote URL
         if hasdriveletter(self.path):
             return True # absolute for our purposes - can't be joined()
-        if self.path.startswith(r'\\'):
+        if self.path.startswith(br'\\'):
             return True # Windows UNC path
         if self.path.startswith('/'):
             return True # POSIX-style