mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 22:06:10 +02:00
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>
This commit is contained in:
parent
63ce337e1d
commit
ffa736a835
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user