##// END OF EJS Templates
py3: fix exception display encoding in contrib/simplemerge.py...
Emmanuel Leblond -
r43684:3c2799cb stable
parent child Browse files
Show More
@@ -18,6 +18,7 b' from mercurial import ('
18 )
18 )
19 from mercurial.utils import (
19 from mercurial.utils import (
20 procutil,
20 procutil,
21 stringutil
21 )
22 )
22
23
23 options = [(b'L', b'label', [], _(b'labels to use on conflict markers')),
24 options = [(b'L', b'label', [], _(b'labels to use on conflict markers')),
@@ -75,8 +76,7 b' try:'
75 context.arbitraryfilectx(other),
76 context.arbitraryfilectx(other),
76 **pycompat.strkwargs(opts)))
77 **pycompat.strkwargs(opts)))
77 except ParseError as e:
78 except ParseError as e:
78 if pycompat.ispy3:
79 e = stringutil.forcebytestr(e)
79 e = str(e).encode('utf8')
80 pycompat.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e))
80 pycompat.stdout.write(b"%s: %s\n" % (sys.argv[0].encode('utf8'), e))
81 showhelp()
81 showhelp()
82 sys.exit(1)
82 sys.exit(1)
General Comments 0
You need to be logged in to leave comments. Login now