Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-08-27 23:08:44 +0400
committerisaacs <i@izs.me>2012-08-27 23:08:44 +0400
commitd801c98c853f0ec2604b0ada8886c073f49ee713 (patch)
tree81b5bafd09dd5e2565eb29ffa8e82a45cfecf307 /node_modules/node-gyp/lib/configure.js
parent3011e62c3f7910702a510f7ddca8a24f743ea28c (diff)
node-gyp@0.6.8
Diffstat (limited to 'node_modules/node-gyp/lib/configure.js')
-rw-r--r--node_modules/node-gyp/lib/configure.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/node_modules/node-gyp/lib/configure.js b/node_modules/node-gyp/lib/configure.js
index 2e1ac504e..3e165afa3 100644
--- a/node_modules/node-gyp/lib/configure.js
+++ b/node_modules/node-gyp/lib/configure.js
@@ -16,6 +16,7 @@ var fs = require('graceful-fs')
, cp = require('child_process')
, exec = cp.exec
, spawn = cp.spawn
+ , execFile = cp.execFile
, win = process.platform == 'win32'
exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module'
@@ -86,21 +87,12 @@ function configure (gyp, argv, callback) {
}
function checkPythonVersion () {
- exec(python + ' --version', function (err, stdout, stderr) {
+ execFile(python, ['-c', 'import platform; print platform.python_version();'], function (err, stdout) {
if (err) {
return callback(err)
}
- log.verbose('check python version', '`%s --version` returned: %j', python, stderr)
- var version = stderr.trim().replace(/[^\d\.]+/g, '')
- var numDots = 0
- version.replace(/\./g, function () {
- numDots++
- })
- while (numDots < 2) {
- version += '.0'
- numDots++
- }
- log.verbose('check python version', 'using version %j to check', version)
+ log.verbose('check python version', '`%s -c "import platform; print platform.python_version();"` returned: %j', python, stdout)
+ var version = stdout.trim()
if (semver.gte(version, '2.5.0') && semver.lt(version, '3.0.0')) {
getNodeDir()
} else {