diff --git a/contrib/simplemerge b/contrib/simplemerge --- a/contrib/simplemerge +++ b/contrib/simplemerge @@ -18,6 +18,7 @@ ) from mercurial.utils import ( procutil, + stringutil ) options = [(b'L', b'label', [], _(b'labels to use on conflict markers')), @@ -75,8 +76,7 @@ context.arbitraryfilectx(other), **pycompat.strkwargs(opts))) except ParseError as e: - if pycompat.ispy3: - e = str(e).encode('utf8') + e = stringutil.forcebytestr(e) pycompat.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e)) showhelp() sys.exit(1)