comparison hgext/phabricator.py @ 42951:04c6de38734d

py3: byte-prefix sanitisation regexes in phabricator.py So it doesn't die with "TypeError: cannot use a string pattern on a bytes-like object". Differential Revision: https://phab.mercurial-scm.org/D6863
author Ian Moody <moz-ian@perix.co.uk>
date Tue, 17 Sep 2019 21:06:07 +0100
parents 6fb281f39c25
children 24bf7a3d3c30
comparison
equal deleted inserted replaced
42950:6fb281f39c25 42951:04c6de38734d
134 r2params = r2.body.split(b'&') 134 r2params = r2.body.split(b'&')
135 return set(r1params) == set(r2params) 135 return set(r1params) == set(r2params)
136 136
137 def sanitiserequest(request): 137 def sanitiserequest(request):
138 request.body = re.sub( 138 request.body = re.sub(
139 r'cli-[a-z0-9]+', 139 br'cli-[a-z0-9]+',
140 r'cli-hahayouwish', 140 br'cli-hahayouwish',
141 request.body 141 request.body
142 ) 142 )
143 return request 143 return request
144 144
145 def sanitiseresponse(response): 145 def sanitiseresponse(response):