py3: add b'' to make sure regex pattern are bytes in hgweb/webutil.py
# skip-blame because we are just adding b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D2260
--- a/mercurial/hgweb/webutil.py Wed Feb 14 15:58:11 2018 +0530
+++ b/mercurial/hgweb/webutil.py Wed Feb 14 16:06:54 2018 +0530
@@ -626,7 +626,7 @@
# delimiters. the replace format and flags are optional, but
# delimiters are required.
match = re.match(
- r'^s%s(.+)(?:(?<=\\\\)|(?<!\\))%s(.*)%s([ilmsux])*$'
+ br'^s%s(.+)(?:(?<=\\\\)|(?<!\\))%s(.*)%s([ilmsux])*$'
% (delim, delim, delim), pattern)
if not match:
repo.ui.warn(_("websub: invalid pattern for %s: %s\n")
@@ -634,7 +634,7 @@
continue
# we need to unescape the delimiter for regexp and format
- delim_re = re.compile(r'(?<!\\)\\%s' % delim)
+ delim_re = re.compile(br'(?<!\\)\\%s' % delim)
regexp = delim_re.sub(unesc, match.group(1))
format = delim_re.sub(unesc, match.group(2))