fix another python3 compatility in websocket

This commit is contained in:
Radek Podgorny 2014-09-30 13:50:43 +02:00
parent 845e4a2426
commit 6ab5121d9a
1 changed files with 1 additions and 1 deletions

View File

@ -388,7 +388,7 @@ class WebSocketRequestHandler(SimpleHTTPRequestHandler):
def send_close(self, code=1000, reason=''): def send_close(self, code=1000, reason=''):
""" Send a WebSocket orderly close frame. """ """ Send a WebSocket orderly close frame. """
msg = pack(">H%ds" % len(reason), code, reason) msg = pack(">H%ds" % len(reason), code, s2b(reason))
buf, h, t = self.encode_hybi(msg, opcode=0x08, base64=False) buf, h, t = self.encode_hybi(msg, opcode=0x08, base64=False)
self.request.send(buf) self.request.send(buf)