comparison mercurial/byterange.py @ 35584:6f62a1c3e11d

py3: make regular expressions bytes by prepending b'' Regexes start with r'' and hence transformer skips adding b'' there. # skip-blame because we are just adding b'' Differential Revision: https://phab.mercurial-scm.org/D1794
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 29 Dec 2017 05:28:05 +0530
parents 1232f7fa00c3
children
comparison
equal deleted inserted replaced
35583:2f123f309f61 35584:6f62a1c3e11d
414 """ 414 """
415 global _rangere 415 global _rangere
416 if range_header is None: 416 if range_header is None:
417 return None 417 return None
418 if _rangere is None: 418 if _rangere is None:
419 _rangere = re.compile(r'^bytes=(\d{1,})-(\d*)') 419 _rangere = re.compile(br'^bytes=(\d{1,})-(\d*)')
420 match = _rangere.match(range_header) 420 match = _rangere.match(range_header)
421 if match: 421 if match:
422 tup = range_tuple_normalize(match.group(1, 2)) 422 tup = range_tuple_normalize(match.group(1, 2))
423 if tup and tup[1]: 423 if tup and tup[1]:
424 tup = (tup[0], tup[1]+1) 424 tup = (tup[0], tup[1]+1)