comparison mercurial/subrepo.py @ 36421:1df7e7b8558e

subrepo: use util.forcebytestr() instead of str() on exception Differential Revision: https://phab.mercurial-scm.org/D2437
author Augie Fackler <augie@google.com>
date Sun, 25 Feb 2018 22:30:14 -0500
parents 976e1cfb2f64
children c6061cadb400
comparison
equal deleted inserted replaced
36420:a39126a40be6 36421:1df7e7b8558e
71 except SubrepoAbort as ex: 71 except SubrepoAbort as ex:
72 # This exception has already been handled 72 # This exception has already been handled
73 raise ex 73 raise ex
74 except error.Abort as ex: 74 except error.Abort as ex:
75 subrepo = subrelpath(self) 75 subrepo = subrelpath(self)
76 errormsg = str(ex) + ' ' + _('(in subrepository "%s")') % subrepo 76 errormsg = (util.forcebytestr(ex) + ' '
77 + _('(in subrepository "%s")') % subrepo)
77 # avoid handling this exception by raising a SubrepoAbort exception 78 # avoid handling this exception by raising a SubrepoAbort exception
78 raise SubrepoAbort(errormsg, hint=ex.hint, subrepo=subrepo, 79 raise SubrepoAbort(errormsg, hint=ex.hint, subrepo=subrepo,
79 cause=sys.exc_info()) 80 cause=sys.exc_info())
80 return res 81 return res
81 return decoratedmethod 82 return decoratedmethod