]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
silence callable warning in hmac
authorBenjamin Peterson <benjamin@python.org>
Tue, 19 Aug 2008 19:07:38 +0000 (19:07 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 19 Aug 2008 19:07:38 +0000 (19:07 +0000)
Lib/hmac.py

index 729ef38ce7601eec8b0316dfc95bb70bbc87cf92..538810630cf3ad5a471082e74f0a1e7d990b10c1 100644 (file)
@@ -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)