diff options
Diffstat (limited to 'deps/npm/node_modules/node-gyp/lib')
-rw-r--r-- | deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs | 4 | ||||
-rw-r--r-- | deps/npm/node_modules/node-gyp/lib/configure.js | 10 |
2 files changed, 4 insertions, 10 deletions
diff --git a/deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs b/deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs index 87e0a9c9bb..6e7429b771 100644 --- a/deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs +++ b/deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs @@ -232,7 +232,9 @@ namespace VisualStudioConfiguration string[] parts = id.Substring(Win10SDKPrefix.Length).Split('.'); if (parts.Length > 1 && parts[1] != "Desktop") continue; - Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(parts[0])); + uint foundSdkVer; + if (UInt32.TryParse(parts[0], out foundSdkVer)) + Win10SDKVer = Math.Max(Win10SDKVer, foundSdkVer); } else if (id == "Microsoft.VisualStudio.Component.Windows81SDK") hasWin8SDK = true; else diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index f141959bca..6ff19559cd 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -448,7 +448,7 @@ PythonFinder.prototype = { }, checkPythonVersion: function checkPythonVersion () { - var args = ['-c', 'import platform; print(platform.python_version());'] + var args = ['-c', 'import sys; print "%s.%s.%s" % sys.version_info[:3];'] var env = extend({}, this.env) env.TERM = 'dumb' @@ -460,14 +460,6 @@ PythonFinder.prototype = { '`%s -c "' + args[1] + '"` returned: %j', this.python, stdout) var version = stdout.trim() - if (~version.indexOf('+')) { - this.log.silly('stripping "+" sign(s) from version') - version = version.replace(/\+/g, '') - } - if (~version.indexOf('rc')) { - this.log.silly('stripping "rc" identifier from version') - version = version.replace(/rc(.*)$/ig, '') - } var range = semver.Range('>=2.5.0 <3.0.0') var valid = false try { |