From 45e3221fd46edf7f14f2c4c640d5f8548d7568f0 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 21 Jan 2019 09:46:23 +0100 Subject: [PATCH] Remove an outdated workaround for Python 2.4 PR-URL: https://github.com/nodejs/node-gyp/pull/1650 Reviewed-By: Ben Noordhuis Reviewed-By: Sakthipriyan Vairamani --- gyp/pylib/gyp/MSVSNew.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gyp/pylib/gyp/MSVSNew.py b/gyp/pylib/gyp/MSVSNew.py index 593f0e5b0b..91fcb413a6 100644 --- a/gyp/pylib/gyp/MSVSNew.py +++ b/gyp/pylib/gyp/MSVSNew.py @@ -4,22 +4,12 @@ """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 - # Initialize random number generator random.seed() @@ -50,7 +40,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] + '}')