configure: inherit from process.env when probing for the python version number

See https://groups.google.com/d/topic/nodejs/qzF9rdMjg6k/discussion
Closes #409
This commit is contained in:
Nathan Rajlich 2014-03-04 14:35:24 -08:00
parent e5ae8e162b
commit e1824656c9

View file

@ -13,6 +13,7 @@ var fs = require('graceful-fs')
, semver = require('semver')
, mkdirp = require('mkdirp')
, cp = require('child_process')
, extend = require('util')._extend
, spawn = cp.spawn
, execFile = cp.execFile
, win = process.platform == 'win32'
@ -72,7 +73,9 @@ function configure (gyp, argv, callback) {
}
function checkPythonVersion () {
var env = { TERM: 'dumb', PATH: process.env.PATH }
var env = extend({}, process.env);
env.TERM = 'dumb';
execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: env }, function (err, stdout) {
if (err) {
return callback(err)