Kaydet (Commit) 4348a256 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

silence callable warning in hmac

üst 5bc9f4c0
...@@ -41,7 +41,7 @@ class HMAC: ...@@ -41,7 +41,7 @@ class HMAC:
import hashlib import hashlib
digestmod = hashlib.md5 digestmod = hashlib.md5
if callable(digestmod): if hasattr(digestmod, '__call__'):
self.digest_cons = digestmod self.digest_cons = digestmod
else: else:
self.digest_cons = lambda d='': digestmod.new(d) self.digest_cons = lambda d='': digestmod.new(d)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment