comparison mercurial/hgweb/webutil.py @ 36258:af0a19d8812b

py3: get bytes-repr of network errors portably This resolves a lot of weird issues in Python 3 around error strings. Differential Revision: https://phab.mercurial-scm.org/D2295
author Augie Fackler <augie@google.com>
date Sat, 17 Feb 2018 01:11:48 -0500
parents 44a519ec5077
children 1fb9e01328e4
comparison
equal deleted inserted replaced
36257:46c97973ee46 36258:af0a19d8812b
345 raise ErrorResponse(HTTP_BAD_REQUEST, 345 raise ErrorResponse(HTTP_BAD_REQUEST,
346 'invalid linerange parameter') 346 'invalid linerange parameter')
347 try: 347 try:
348 return util.processlinerange(fromline, toline) 348 return util.processlinerange(fromline, toline)
349 except error.ParseError as exc: 349 except error.ParseError as exc:
350 raise ErrorResponse(HTTP_BAD_REQUEST, str(exc)) 350 raise ErrorResponse(HTTP_BAD_REQUEST, pycompat.bytestr(exc))
351 351
352 def formatlinerange(fromline, toline): 352 def formatlinerange(fromline, toline):
353 return '%d:%d' % (fromline + 1, toline) 353 return '%d:%d' % (fromline + 1, toline)
354 354
355 def succsandmarkers(repo, ctx): 355 def succsandmarkers(repo, ctx):