From ffa736a8357c7d82bc88ce62fce4de166a0c0bd4 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Wed, 9 Nov 2016 14:17:13 +0900 Subject: wsgi: Use six.text_type instead of unicode This issue is suggested by Marcel Grossmann on GitHub PR #53. Signed-off-by: IWASE Yusuke Signed-off-by: FUJITA Tomonori --- ryu/app/wsgi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ryu/app/wsgi.py b/ryu/app/wsgi.py index 3c8bc936..fbfa0e79 100644 --- a/ryu/app/wsgi.py +++ b/ryu/app/wsgi.py @@ -17,6 +17,7 @@ import inspect from types import MethodType +import six from tinyrpc.server import RPCServer from tinyrpc.dispatch import RPCDispatcher from tinyrpc.dispatch import public as rpc_public @@ -139,7 +140,7 @@ class WebSocketServerTransport(ServerTransport): return (context, message) def send_reply(self, context, reply): - self.ws.send(unicode(reply)) + self.ws.send(six.text_type(reply)) class WebSocketRPCServer(RPCServer): @@ -169,7 +170,7 @@ class WebSocketClientTransport(ClientTransport): self.queue = queue def send_message(self, message, expect_reply=True): - self.ws.send(unicode(message)) + self.ws.send(six.text_type(message)) if expect_reply: return self.queue.get() -- cgit v1.2.3