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 44
55"""New implementation of Visual Studio project generation."""
66
7+ import hashlib
78import os
89import random
910
1011import gyp .common
1112
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-
2313
2414# Initialize random number generator
2515random .seed ()
@@ -50,7 +40,7 @@ def MakeGuid(name, seed='msvs_new'):
5040 not change when the project for a target is rebuilt.
5141 """
5242 # 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 ()
5444 # Convert most of the signature to GUID form (discard the rest)
5545 guid = ('{' + d [:8 ] + '-' + d [8 :12 ] + '-' + d [12 :16 ] + '-' + d [16 :20 ]
5646 + '-' + d [20 :32 ] + '}' )
You can’t perform that action at this time.
0 commit comments