diff options
author | liris <liris.pp@gmail.com> | 2019-12-25 21:37:21 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-25 21:37:21 +0900 |
commit | 9c73ddfbeb00fac9aa19c856d0b3b225a444dfc1 (patch) | |
tree | 8423a6b8226407f90c5456c7e56ee1534c056ae6 | |
parent | 10fc21bd13c05854f16b8d6ab0723ab718089cae (diff) | |
parent | db9cc6b1f46310e2ab0074d5dbeb6f1ed08e9f58 (diff) | |
download | websocket-client-9c73ddfbeb00fac9aa19c856d0b3b225a444dfc1.tar.gz |
Merge pull request #533 from sfoerster/master
_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 9a727dc..7476a07 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 |