summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Foerster <sfoerster@gmail.com>2019-03-14 08:30:44 -0400
committerSteven Foerster <sfoerster@gmail.com>2019-03-14 08:30:44 -0400
commitdb9cc6b1f46310e2ab0074d5dbeb6f1ed08e9f58 (patch)
treec77925973149a87b7a091b341f33e88d456144d0
parent66081be8e0523c9dfaffcb18ba1c8e4765e2288e (diff)
downloadwebsocket-client-db9cc6b1f46310e2ab0074d5dbeb6f1ed08e9f58.tar.gz
_handshake: hasattr checks on six before accessing the values
-rw-r--r--websocket/_handshake.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/websocket/_handshake.py b/websocket/_handshake.py
index 809a8c9..c4bcb69 100644
--- a/websocket/_handshake.py
+++ b/websocket/_handshake.py
@@ -31,13 +31,13 @@ from ._http import *
from ._logging import *
from ._socket import *
-if six.PY3:
+if hasattr(six, 'PY3') and six.PY3:
from base64 import encodebytes as base64encode
else:
from base64 import encodestring as base64encode
-if six.PY3:
- if six.PY34:
+if hasattr(six, 'PY3') and six.PY3:
+ if hasattr(six, 'PY34') and six.PY34:
from http import client as HTTPStatus
else:
from http import HTTPStatus