mirror of https://github.com/python/cpython
silence callable warning in hmac
This commit is contained in:
parent
5bc9f4c09c
commit
4348a25665
|
@ -41,7 +41,7 @@ class HMAC:
|
|||
import hashlib
|
||||
digestmod = hashlib.md5
|
||||
|
||||
if callable(digestmod):
|
||||
if hasattr(digestmod, '__call__'):
|
||||
self.digest_cons = digestmod
|
||||
else:
|
||||
self.digest_cons = lambda d='': digestmod.new(d)
|
||||
|
|
Loading…
Reference in New Issue