Closes #13258: Use callable() built-in in the standard library.
diff --git a/Lib/hmac.py b/Lib/hmac.py
index e878e1a..956fc65 100644
--- a/Lib/hmac.py
+++ b/Lib/hmac.py
@@ -39,7 +39,7 @@
             import hashlib
             digestmod = hashlib.md5
 
-        if hasattr(digestmod, '__call__'):
+        if callable(digestmod):
             self.digest_cons = digestmod
         else:
             self.digest_cons = lambda d=b'': digestmod.new(d)