Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions Lib/hmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ def __init(self, key, msg, digestmod):
try:
self._init_openssl_hmac(key, msg, digestmod)
return
except _hashopenssl.UnsupportedDigestmodError:
except _hashopenssl.UnsupportedDigestmodError: # pragma: no cover
pass
if _hmac and isinstance(digestmod, str):
try:
self._init_builtin_hmac(key, msg, digestmod)
return
except _hmac.UnknownHashError:
except _hmac.UnknownHashError: # pragma: no cover
pass
self._init_old(key, msg, digestmod)

Expand Down Expand Up @@ -121,12 +121,12 @@ def _init_old(self, key, msg, digestmod):
warnings.warn(f"block_size of {blocksize} seems too small; "
f"using our default of {self.blocksize}.",
RuntimeWarning, 2)
blocksize = self.blocksize
blocksize = self.blocksize # pragma: no cover
else:
warnings.warn("No block_size attribute on given digest object; "
f"Assuming {self.blocksize}.",
RuntimeWarning, 2)
blocksize = self.blocksize
blocksize = self.blocksize # pragma: no cover

if len(key) > blocksize:
key = digest_cons(key).digest()
Expand Down
Loading
Loading