Patchwork D5826: check-config: use raw strings for regular expressions

login
register
mail settings
Submitter phabricator
Date Feb. 4, 2019, 11:36 p.m.
Message ID <617c4bb3b5365f78d467c0a22f813442@localhost.localdomain>
Download mbox | patch
Permalink /patch/38405/
State Not Applicable
Headers show

Comments

phabricator - Feb. 4, 2019, 11:36 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG595a67a301ee: check-config: use raw strings for regular expressions (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5826?vs=13753&id=13785

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

AFFECTED FILES
  contrib/check-config.py

CHANGE DETAILS




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

Patch

diff --git a/contrib/check-config.py b/contrib/check-config.py
--- a/contrib/check-config.py
+++ b/contrib/check-config.py
@@ -25,7 +25,7 @@ 
         (?:default=)?(?P<default>\S+?))?
     \)''', re.VERBOSE | re.MULTILINE)
 
-configwithre = re.compile(b'''
+configwithre = re.compile(br'''
     ui\.config(?P<ctype>with)\(
         # First argument is callback function. This doesn't parse robustly
         # if it is e.g. a function call.
@@ -61,10 +61,10 @@ 
             linenum += 1
 
             # check topic-like bits
-            m = re.match(b'\s*``(\S+)``', l)
+            m = re.match(br'\s*``(\S+)``', l)
             if m:
                 prevname = m.group(1)
-            if re.match(b'^\s*-+$', l):
+            if re.match(br'^\s*-+$', l):
                 sect = prevname
                 prevname = b''