Mercurial > hg > mercurial-source
diff mercurial/parser.py @ 37333: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 (2018-03-01) |
parents | a8994d08e4a2 |
children | f0b6fbea00cf |
line wrap: on
line diff
--- a/mercurial/parser.py +++ b/mercurial/parser.py @@ -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):