summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py')
-rw-r--r--deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
index 593f0e5b0b..0ec628cc1f 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
@@ -4,22 +4,17 @@
"""New implementation of Visual Studio project generation."""
+import hashlib
import os
import random
import gyp.common
-# hashlib is supplied as of Python 2.5 as the replacement interface for md5
-# and other secure hashes. In 2.6, md5 is deprecated. Import hashlib if
-# available, avoiding a deprecation warning under 2.6. Import md5 otherwise,
-# preserving 2.4 compatibility.
try:
- import hashlib
- _new_md5 = hashlib.md5
-except ImportError:
- import md5
- _new_md5 = md5.new
-
+ cmp
+except NameError:
+ def cmp(x, y):
+ return (x > y) - (x < y)
# Initialize random number generator
random.seed()
@@ -50,7 +45,7 @@ def MakeGuid(name, seed='msvs_new'):
not change when the project for a target is rebuilt.
"""
# Calculate a MD5 signature for the seed and name.
- d = _new_md5(str(seed) + str(name)).hexdigest().upper()
+ d = hashlib.md5(str(seed) + str(name)).hexdigest().upper()
# Convert most of the signature to GUID form (discard the rest)
guid = ('{' + d[:8] + '-' + d[8:12] + '-' + d[12:16] + '-' + d[16:20]
+ '-' + d[20:32] + '}')