Skip to content

Commit

Permalink
Merge pull request #74 from michalpokusa/optional-hashlib-for-websockets
Browse files Browse the repository at this point in the history
Alternative import to `hashlib` and warning message about Websocket support
  • Loading branch information
FoamyGuy authored Dec 17, 2023
2 parents d1a078b + 9911f35 commit 8e0b86a
Showing 1 changed file with 11 additions and 1 deletion.
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

0 comments on commit 8e0b86a

Please sign in to comment.