py3: stringify integer with %d instead of bytes()
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 14 Feb 2018 17:35:13 -0700
changeset 36213 b67d4b7e8235
parent 36212 7a46f0735904
child 36214 3b3a987bbbaa
py3: stringify integer with %d instead of bytes() The unbundle wire protocol command now returns a properly formatted reply in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2274
mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py	Wed Feb 14 17:23:26 2018 -0700
+++ b/mercurial/wireprotoserver.py	Wed Feb 14 17:35:13 2018 -0700
@@ -445,7 +445,7 @@
                 _sshv1respondstream(self._fout, rsp)
             elif isinstance(rsp, wireprototypes.pushres):
                 _sshv1respondbytes(self._fout, b'')
-                _sshv1respondbytes(self._fout, bytes(rsp.res))
+                _sshv1respondbytes(self._fout, b'%d' % rsp.res)
             elif isinstance(rsp, wireprototypes.pusherr):
                 _sshv1respondbytes(self._fout, rsp.res)
             elif isinstance(rsp, wireprototypes.ooberror):