Show More
@@ -20,28 +20,26 b' import imp' | |||
|
20 | 20 | |
|
21 | 21 | # Python compatibility |
|
22 | 22 | |
|
23 | _md5 = None | |
|
24 | 23 | def md5(s): |
|
25 | global _md5 | |
|
26 | if _md5 is None: | |
|
27 | try: | |
|
28 | import hashlib | |
|
29 | _md5 = hashlib.md5 | |
|
30 | except ImportError: | |
|
31 | import md5 | |
|
32 |
|
|
|
24 | try: | |
|
25 | import hashlib | |
|
26 | _md5 = hashlib.md5 | |
|
27 | except ImportError: | |
|
28 | import md5 | |
|
29 | _md5 = md5.md5 | |
|
30 | global md5 | |
|
31 | md5 = _md5 | |
|
33 | 32 | return _md5(s) |
|
34 | 33 | |
|
35 | _sha1 = None | |
|
36 | 34 | def sha1(s): |
|
37 | global _sha1 | |
|
38 | if _sha1 is None: | |
|
39 | try: | |
|
40 | import hashlib | |
|
41 | _sha1 = hashlib.sha1 | |
|
42 | except ImportError: | |
|
43 | import sha | |
|
44 |
|
|
|
35 | try: | |
|
36 | import hashlib | |
|
37 | _sha1 = hashlib.sha1 | |
|
38 | except ImportError: | |
|
39 | import sha | |
|
40 | _sha1 = sha.sha | |
|
41 | global sha1 | |
|
42 | sha1 = _sha1 | |
|
45 | 43 | return _sha1(s) |
|
46 | 44 | |
|
47 | 45 | import subprocess |
General Comments 0
You need to be logged in to leave comments.
Login now