Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative import to hashlib and warning message about Websocket support #74

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion adafruit_httpserver/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@
import os
import json
from binascii import b2a_base64
import hashlib
from errno import EAGAIN, ECONNRESET, ETIMEDOUT, ENOTCONN

try:
try:
import hashlib
except ImportError:
import adafruit_hashlib as hashlib
except ImportError:
print(
"WARNING: hashlib module not available and adafruit_hashlib not installed.",
"Websocket support will not work.",
)

from .exceptions import (
BackslashInPathError,
FileNotExistsError,
Expand Down