##// END OF EJS Templates
util: remove warnings when importing md5 and sha
Sune Foldager -
r8295:1ea7e7d9 default
parent child Browse files
Show More
@@ -25,8 +25,7 def md5(s):
25 import hashlib
25 import hashlib
26 _md5 = hashlib.md5
26 _md5 = hashlib.md5
27 except ImportError:
27 except ImportError:
28 import md5
28 from md5 import md5 as _md5
29 _md5 = md5.md5
30 global md5
29 global md5
31 md5 = _md5
30 md5 = _md5
32 return _md5(s)
31 return _md5(s)
@@ -36,8 +35,7 def sha1(s):
36 import hashlib
35 import hashlib
37 _sha1 = hashlib.sha1
36 _sha1 = hashlib.sha1
38 except ImportError:
37 except ImportError:
39 import sha
38 from sha import sha as _sha1
40 _sha1 = sha.sha
41 global sha1
39 global sha1
42 sha1 = _sha1
40 sha1 = _sha1
43 return _sha1(s)
41 return _sha1(s)
General Comments 0
You need to be logged in to leave comments. Login now