From db9cc6b1f46310e2ab0074d5dbeb6f1ed08e9f58 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Thu, 14 Mar 2019 08:30:44 -0400 Subject: _handshake: hasattr checks on six before accessing the values --- websocket/_handshake.py | 6 +++--- 1 file 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 -- cgit v1.2.1