Mercurial > public > mercurial-scm > hg
diff mercurial/parser.py @ 36547:7840d8bd0558
py3: byte-stringify ValueError of unescapestr() to reraise as ParseError
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 01 Mar 2018 17:03:40 -0500 |
parents | a8994d08e4a2 |
children | f0b6fbea00cf |
line wrap: on
line diff
--- a/mercurial/parser.py Thu Mar 01 16:56:38 2018 -0500 +++ b/mercurial/parser.py Thu Mar 01 17:03:40 2018 -0500 @@ -22,6 +22,7 @@ from . import ( encoding, error, + pycompat, util, ) @@ -192,7 +193,7 @@ return util.unescapestr(s) except ValueError as e: # mangle Python's exception into our format - raise error.ParseError(str(e).lower()) + raise error.ParseError(pycompat.bytestr(e).lower()) def _brepr(obj): if isinstance(obj, bytes):