comparison mercurial/hgweb/hgweb_mod.py @ 26200:461e7b700fdf

hgweb: remove ErrorResponse.message BaseException.message is deprecated: https://www.python.org/dev/peps/pep-0352/#retracted-ideas
author timeless@mozdev.org
date Tue, 08 Sep 2015 14:56:29 -0400
parents bf1b24785f13
children 18e1c555ee49
comparison
equal deleted inserted replaced
26199:5411059d93f8 26200:461e7b700fdf
354 req.env.get('X-HgHttp2', '')): 354 req.env.get('X-HgHttp2', '')):
355 req.drain() 355 req.drain()
356 else: 356 else:
357 req.headers.append(('Connection', 'Close')) 357 req.headers.append(('Connection', 'Close'))
358 req.respond(inst, protocol.HGTYPE, 358 req.respond(inst, protocol.HGTYPE,
359 body='0\n%s\n' % inst.message) 359 body='0\n%s\n' % inst)
360 return '' 360 return ''
361 361
362 # translate user-visible url structure to internal structure 362 # translate user-visible url structure to internal structure
363 363
364 args = query.split('/', 2) 364 args = query.split('/', 2)
437 except ErrorResponse as inst: 437 except ErrorResponse as inst:
438 req.respond(inst, ctype) 438 req.respond(inst, ctype)
439 if inst.code == HTTP_NOT_MODIFIED: 439 if inst.code == HTTP_NOT_MODIFIED:
440 # Not allowed to return a body on a 304 440 # Not allowed to return a body on a 304
441 return [''] 441 return ['']
442 return tmpl('error', error=inst.message) 442 return tmpl('error', error=str(inst))
443 443
444 def check_perm(self, rctx, req, op): 444 def check_perm(self, rctx, req, op):
445 for permhook in permhooks: 445 for permhook in permhooks:
446 permhook(rctx, req, op) 446 permhook(rctx, req, op)