##// END OF EJS Templates
py3: byte-stringify ValueError of unescapestr() to reraise as ParseError
Yuya Nishihara -
r36565:7840d8bd default
parent child Browse files
Show More
@@ -22,6 +22,7 b' from .i18n import _'
22 from . import (
22 from . import (
23 encoding,
23 encoding,
24 error,
24 error,
25 pycompat,
25 util,
26 util,
26 )
27 )
27
28
@@ -192,7 +193,7 b' def unescapestr(s):'
192 return util.unescapestr(s)
193 return util.unescapestr(s)
193 except ValueError as e:
194 except ValueError as e:
194 # mangle Python's exception into our format
195 # mangle Python's exception into our format
195 raise error.ParseError(str(e).lower())
196 raise error.ParseError(pycompat.bytestr(e).lower())
196
197
197 def _brepr(obj):
198 def _brepr(obj):
198 if isinstance(obj, bytes):
199 if isinstance(obj, bytes):
General Comments 0
You need to be logged in to leave comments. Login now