changeset 39838:bce1c1af7518

py3: cast exception to bytes In order to appease Python 3. Differential Revision: https://phab.mercurial-scm.org/D4733
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 25 Sep 2018 18:59:04 -0700
parents 69b4a5b89dc5
children 9e8fcd2e78c1
files mercurial/wireprotoframing.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireprotoframing.py	Tue Sep 25 09:11:56 2018 -0700
+++ b/mercurial/wireprotoframing.py	Tue Sep 25 18:59:04 2018 -0700
@@ -827,9 +827,10 @@
                     break
 
                 except Exception as e:
-                    for frame in createerrorframe(stream, requestid,
-                                                  '%s' % e,
-                                                  errtype='server'):
+                    for frame in createerrorframe(
+                        stream, requestid, '%s' % stringutil.forcebytestr(e),
+                        errtype='server'):
+
                         yield frame
 
                     break