comparison mercurial/ui.py @ 33108: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 c41cbe98822c
children 77e666f943a6
comparison
equal deleted inserted replaced
33107:9fc880dff5f3 33108:d9962854a4a2
1255 # Sadly, the prompt string may have been built with a filename 1255 # Sadly, the prompt string may have been built with a filename
1256 # containing "$$" so let's try to find the first valid-looking 1256 # containing "$$" so let's try to find the first valid-looking
1257 # prompt to start parsing. Sadly, we also can't rely on 1257 # prompt to start parsing. Sadly, we also can't rely on
1258 # choices containing spaces, ASCII, or basically anything 1258 # choices containing spaces, ASCII, or basically anything
1259 # except an ampersand followed by a character. 1259 # except an ampersand followed by a character.
1260 m = re.match(r'(?s)(.+?)\$\$([^\$]*&[^ \$].*)', prompt) 1260 m = re.match(br'(?s)(.+?)\$\$([^\$]*&[^ \$].*)', prompt)
1261 msg = m.group(1) 1261 msg = m.group(1)
1262 choices = [p.strip(' ') for p in m.group(2).split('$$')] 1262 choices = [p.strip(' ') for p in m.group(2).split('$$')]
1263 return (msg, 1263 return (msg,
1264 [(s[s.index('&') + 1].lower(), s.replace('&', '', 1)) 1264 [(s[s.index('&') + 1].lower(), s.replace('&', '', 1))
1265 for s in choices]) 1265 for s in choices])