py3: convert exceptions to bytes using pycompat.bytestr()
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 12 Jul 2019 10:26:41 -0700
changeset 4759 f30c1fab7155
parent 4758 f0ecf2137824
child 4760 7e034d44bd4b
py3: convert exceptions to bytes using pycompat.bytestr()
hgext3rd/evolve/cmdrewrite.py
hgext3rd/topic/stack.py
--- a/hgext3rd/evolve/cmdrewrite.py	Thu Jul 11 16:00:25 2019 -0700
+++ b/hgext3rd/evolve/cmdrewrite.py	Fri Jul 12 10:26:41 2019 -0700
@@ -666,7 +666,7 @@
             patch.patchrepo(ui, repo, pold, store, fp, 1, '',
                             files=files, eolmode=None)
         except patch.PatchError as err:
-            raise error.Abort(str(err))
+            raise error.Abort(pycompat.bytestr(err))
 
         finally:
             del fp
--- a/hgext3rd/topic/stack.py	Thu Jul 11 16:00:25 2019 -0700
+++ b/hgext3rd/topic/stack.py	Fri Jul 12 10:26:41 2019 -0700
@@ -8,6 +8,7 @@
     error,
     node,
     phases,
+    pycompat,
     obsolete,
     util,
 )
@@ -204,7 +205,7 @@
                 return 0
             except error.ManyMergeDestAbort as exc:
                 # XXX we should make it easier for upstream to provide the information
-                self.behinderror = str(exc).split('-', 1)[0].rstrip()
+                self.behinderror = pycompat.bytestr(exc).split('-', 1)[0].rstrip()
                 return -1
         return 0