pass all tests on pypy3 2.4.0
This commit is contained in:
liris
2015-05-07 09:27:52 +09:00
parent c586a302fc
commit 8f7a4c7fef
2 changed files with 8 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ class handshake_response(object):
self.headers = headers
self.subprotocol = subprotocol
def handshake(sock, hostname, port, resource, **options):
headers, key = _get_handshake_headers(resource, hostname, port, options)

View File

@@ -23,6 +23,12 @@ else:
import uuid
if six.PY3:
from base64 import decodebytes as base64decode
else:
from base64 import decodestring as base64decode
# websocket-client
import websocket as ws
from websocket._handshake import _create_sec_websocket_key
@@ -462,7 +468,7 @@ class WebSocketTest(unittest.TestCase):
""" WebSocket key should be a UUID4.
"""
key = _create_sec_websocket_key()
u = uuid.UUID(bytes=base64.b64decode(key))
u = uuid.UUID(bytes=base64decode(key.encode("utf-8")))
self.assertEqual(4, u.version)