Skip to content

Commit

Permalink
Merge pull request #527 from bendavis78/issue_526
Browse files Browse the repository at this point in the history
Fixed #526. Check for python2 executable by default, fallback to python
  • Loading branch information
TooTallNate committed May 24, 2015
2 parents 15f6aeb + cf0ddf6 commit 1d48609
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' f

function configure (gyp, argv, callback) {

var python = gyp.opts.python || process.env.PYTHON || 'python'
var python = gyp.opts.python || process.env.PYTHON || 'python2'
, buildDir = path.resolve('build')
, configNames = [ 'config.gypi', 'common.gypi' ]
, configs = []
, nodeDir

checkPython()
checkPython(python)

// Check if Python is in the $PATH
function checkPython () {
function checkPython (pythonCmd) {
log.verbose('check python', 'checking for Python executable "%s" in the PATH', python)
which(python, function (err, execPath) {
if (err) {
log.verbose('`which` failed', python, err)
if (python === 'python2') {
return checkPython('python');
}
if (win) {
guessPython()
} else {
Expand Down

0 comments on commit 1d48609

Please sign in to comment.