summaryrefslogtreecommitdiff
path: root/websocket
diff options
context:
space:
mode:
authorPär Tojkander <par.tojkander@assaabloy.com>2018-10-11 11:04:58 +0200
committerPär Tojkander <par.tojkander@assaabloy.com>2018-10-11 11:04:58 +0200
commitda1fdb16927f01420749d121cc17666a66684587 (patch)
tree7480e0eaf408c647882c3dbe3c6137d204239564 /websocket
parentb65f8ba4b935528a56c751c2f1de7a7d2d12f17e (diff)
downloadwebsocket-client-da1fdb16927f01420749d121cc17666a66684587.tar.gz
Handle PY2/3
Diffstat (limited to 'websocket')
-rw-r--r--websocket/_handshake.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/websocket/_handshake.py b/websocket/_handshake.py
index e28e88d..8c6f6a6 100644
--- a/websocket/_handshake.py
+++ b/websocket/_handshake.py
@@ -22,7 +22,6 @@ Copyright (C) 2010 Hiroki Ohtani(liris)
import hashlib
import hmac
import os
-from http import HTTPStatus
import six
@@ -37,6 +36,11 @@ if six.PY3:
else:
from base64 import encodestring as base64encode
+if six.PY3:
+ from http import HTTPStatus
+else:
+ import httplib as HTTPStatus
+
__all__ = ["handshake_response", "handshake", "SUPPORTED_REDIRECT_STATUSES"]
if hasattr(hmac, "compare_digest"):