Mercurial > hg
changeset 41541:595a67a301ee
check-config: use raw strings for regular expressions
This avoids SyntaxWarning on Python 3.8 for invalid \ escapes.
Differential Revision: https://phab.mercurial-scm.org/D5826
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 04 Feb 2019 09:34:11 -0800 |
parents | 17a6e063c886 |
children | 8d4ee2d9ffb8 |
files | contrib/check-config.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-config.py Mon Feb 04 09:32:30 2019 -0800 +++ b/contrib/check-config.py Mon Feb 04 09:34:11 2019 -0800 @@ -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''