From 3b86571de33c39250c81bc492adf3c09632c5d8a Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 20 May 2016 12:12:07 -0700 Subject: [PATCH] fix py3 --- src/wormhole/server/rendezvous.py | 2 +- src/wormhole/test/test_server.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wormhole/server/rendezvous.py b/src/wormhole/server/rendezvous.py index 38f7af3..018b8e2 100644 --- a/src/wormhole/server/rendezvous.py +++ b/src/wormhole/server/rendezvous.py @@ -18,7 +18,7 @@ def get_sides(row): def make_sides(sides): return list(sides) + [None] * (2 - len(sides)) def generate_mailbox_id(): - return base64.b32encode(os.urandom(8)).lower().strip("=") + return base64.b32encode(os.urandom(8)).lower().strip(b"=").decode("ascii") SideResult = namedtuple("SideResult", ["changed", "empty", "side1", "side2"]) diff --git a/src/wormhole/test/test_server.py b/src/wormhole/test/test_server.py index d7377d1..b654a24 100644 --- a/src/wormhole/test/test_server.py +++ b/src/wormhole/test/test_server.py @@ -483,7 +483,7 @@ class WebSocketAPI(ServerBase, unittest.TestCase): c1.send(u"bind", appid=u"appid", side=u"side") yield c1.sync() - self.assertEqual(self._rendezvous._apps.keys(), [u"appid"]) + self.assertEqual(list(self._rendezvous._apps.keys()), [u"appid"]) c1.send(u"bind", appid=u"appid", side=u"side") # duplicate err = yield c1.next_non_ack()