Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 35166:25c543944bc0
py3: add b'' to regular expressions which are raw strings
Differential Revision: https://phab.mercurial-scm.org/D1538
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 29 Nov 2017 04:47:27 +0530 |
parents | be6aa0cff8ea |
children | 8652ab4046e4 |
comparison
equal
deleted
inserted
replaced
35165:8f6641fa7c89 | 35166:25c543944bc0 |
---|---|
2665 if len(prefix) > 1: | 2665 if len(prefix) > 1: |
2666 prefix_char = prefix[1:] | 2666 prefix_char = prefix[1:] |
2667 else: | 2667 else: |
2668 prefix_char = prefix | 2668 prefix_char = prefix |
2669 mapping[prefix_char] = prefix_char | 2669 mapping[prefix_char] = prefix_char |
2670 r = remod.compile(r'%s(%s)' % (prefix, patterns)) | 2670 r = remod.compile(br'%s(%s)' % (prefix, patterns)) |
2671 return r.sub(lambda x: fn(mapping[x.group()[1:]]), s) | 2671 return r.sub(lambda x: fn(mapping[x.group()[1:]]), s) |
2672 | 2672 |
2673 def getport(port): | 2673 def getport(port): |
2674 """Return the port for a given network service. | 2674 """Return the port for a given network service. |
2675 | 2675 |