py3: fix test-wireproto.py

Summary: Makes it pass

Reviewed By: xavierd

Differential Revision: D20933051

fbshipit-source-id: e32ff04597a86fb9674b5a734acc856456f48033
This commit is contained in:
Durham Goode 2020-04-10 10:56:22 -07:00 committed by Facebook GitHub Bot
parent b2c2642e82
commit cf4a93bfa0
2 changed files with 6 additions and 7 deletions

View File

@ -520,7 +520,7 @@ class wirepeer(repository.legacypeer):
while b";" not in chunk and chunk:
chunk = rsp.read(1024)
work.append(chunk)
merged = "".join(work)
merged = b"".join(work)
while b";" in merged:
one, merged = merged.split(b";", 1)
yield unescapebytearg(one)

View File

@ -1,12 +1,9 @@
from __future__ import absolute_import, print_function
from edenscm.mercurial import ui, util, wireproto
from edenscm.mercurial import pycompat, ui, util, wireproto
from hghave import require
require(["py2"])
stringio = util.stringio
@ -48,7 +45,9 @@ class clientpeer(wireproto.wirepeer):
return ["batch"]
def _call(self, cmd, **args):
return wireproto.dispatch(self.serverrepo, proto(args), cmd)
return pycompat.encodeutf8(
wireproto.dispatch(self.serverrepo, proto(args), cmd)
)
def _callstream(self, cmd, **args):
return stringio(self._call(cmd, **args))
@ -57,7 +56,7 @@ class clientpeer(wireproto.wirepeer):
def greet(self, name):
f = wireproto.future()
yield {"name": mangle(name)}, f
yield unmangle(f.value)
yield unmangle(pycompat.decodeutf8(f.value))
class serverrepo(object):