File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 4
4
5
5
"""New implementation of Visual Studio project generation."""
6
6
7
+ import hashlib
7
8
import os
8
9
import random
9
10
10
11
import gyp .common
11
12
12
- # hashlib is supplied as of Python 2.5 as the replacement interface for md5
13
- # and other secure hashes. In 2.6, md5 is deprecated. Import hashlib if
14
- # available, avoiding a deprecation warning under 2.6. Import md5 otherwise,
15
- # preserving 2.4 compatibility.
16
- try :
17
- import hashlib
18
- _new_md5 = hashlib .md5
19
- except ImportError :
20
- import md5
21
- _new_md5 = md5 .new
22
-
23
13
24
14
# Initialize random number generator
25
15
random .seed ()
@@ -50,7 +40,7 @@ def MakeGuid(name, seed='msvs_new'):
50
40
not change when the project for a target is rebuilt.
51
41
"""
52
42
# Calculate a MD5 signature for the seed and name.
53
- d = _new_md5 (str (seed ) + str (name )).hexdigest ().upper ()
43
+ d = hashlib . md5 (str (seed ) + str (name )).hexdigest ().upper ()
54
44
# Convert most of the signature to GUID form (discard the rest)
55
45
guid = ('{' + d [:8 ] + '-' + d [8 :12 ] + '-' + d [12 :16 ] + '-' + d [16 :20 ]
56
46
+ '-' + d [20 :32 ] + '}' )
You can’t perform that action at this time.
0 commit comments