Skip to content

Commit 74239be

Browse files
authored
fix again!
1 parent df36d7d commit 74239be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/hmac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def digest(key, msg, digest):
242242
try:
243243
return _hashopenssl.hmac_digest(key, msg, digest)
244244
except OverflowError as exc:
245-
if _hmac is None or not isinstance(digest, str):
245+
if (not _hmac and isinstance(digest, str)) or callable(digest):
246246
# Without re-raising now, slow HMAC will be used as
247247
# HACL* HMAC only identifies digests by their name.
248248
raise exc

0 commit comments

Comments
 (0)