[cmcic] use hashlib instead of sha
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 05 Aug 2015 17:02:32 +0200
changeset 27 0085aa85403c
parent 26 2a219898bebc
child 29 efe18c655465
[cmcic] use hashlib instead of sha The latter is deprecated.
cmcic.py
--- a/cmcic.py	Wed Aug 05 16:49:13 2015 +0200
+++ b/cmcic.py	Wed Aug 05 17:02:32 2015 +0200
@@ -118,7 +118,7 @@
 """
 __docformat__ = 'restructuredtext'
 
-import hmac, sha, os.path, ConfigParser
+import hmac, hashlib, os.path, ConfigParser
 
 def dict_translate(msg, map):
     result = {}
@@ -202,7 +202,7 @@
         return hexStrKey
 
     def compute_hmac(self, data):
-        hash = hmac.HMAC(self.tpe_key, None, sha)
+        hash = hmac.HMAC(self.tpe_key, None, hashlib.sha1)
         hash.update(data)
         return hash.hexdigest()