summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-11-09 14:17:13 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-11-14 18:14:25 +0900
commitffa736a8357c7d82bc88ce62fce4de166a0c0bd4 (patch)
tree6488d89fe8baf3ae011bfd8049dde513e023960f
parent63ce337e1d88913f1aa6684496bdbd4c6de37a8a (diff)
wsgi: Use six.text_type instead of unicode
This issue is suggested by Marcel Grossmann on GitHub PR #53. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/app/wsgi.py5
1 files 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()