diff options
author | Steven Foerster <sfoerster@gmail.com> | 2019-03-14 08:30:44 -0400 |
---|---|---|
committer | Steven Foerster <sfoerster@gmail.com> | 2019-03-14 08:30:44 -0400 |
commit | db9cc6b1f46310e2ab0074d5dbeb6f1ed08e9f58 (patch) | |
tree | c77925973149a87b7a091b341f33e88d456144d0 | |
parent | 66081be8e0523c9dfaffcb18ba1c8e4765e2288e (diff) | |
download | websocket-client-db9cc6b1f46310e2ab0074d5dbeb6f1ed08e9f58.tar.gz |
_handshake: hasattr checks on six before accessing the values
-rw-r--r-- | websocket/_handshake.py | 6 |
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 |