# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-03-01 18:24:52 # Node ID 6e90c59b6da13bc9db5c89127bbe7d12686eee10 # Parent 149c5af35de5f3c46e97e7d41f345de7cfbf37cc py3: use pycompat.bytestr() to convert error instances to bytes Differential Revision: https://phab.mercurial-scm.org/D2516 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2370,7 +2370,7 @@ def grep(ui, repo, pattern, *pats, **opt try: regexp = util.re.compile(pattern, reflags) except re.error as inst: - ui.warn(_("grep: invalid match pattern: %s\n") % inst) + ui.warn(_("grep: invalid match pattern: %s\n") % pycompat.bytestr(inst)) return 1 sep, eol = ':', '\n' if opts.get('print0'): diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -1591,7 +1591,8 @@ def debugobsolete(ui, repo, precursor=No metadata=metadata, ui=ui) tr.close() except ValueError as exc: - raise error.Abort(_('bad obsmarker input: %s') % exc) + raise error.Abort(_('bad obsmarker input: %s') % + pycompat.bytestr(exc)) finally: tr.release() finally: