diff --git a/lib/configure.js b/lib/configure.js index 2ff476deb1..c828c0f4e8 100644 --- a/lib/configure.js +++ b/lib/configure.js @@ -14,7 +14,6 @@ var fs = require('graceful-fs') , semver = require('semver') , mkdirp = require('mkdirp') , cp = require('child_process') - , PathArray = require('path-array') , extend = require('util')._extend , processRelease = require('./process-release') , spawn = cp.spawn @@ -288,8 +287,9 @@ function configure (gyp, argv, callback) { argv.unshift(gyp_script) // make sure python uses files that came with this particular node package - var pypath = new PathArray(process.env, 'PYTHONPATH') - pypath.unshift(path.join(__dirname, '..', 'gyp', 'pylib')) + var pypath = process.env.PYTHONPATH ? [process.env.PYTHONPATH] : [] + pypath.unshift(path.resolve(__dirname, '..', 'gyp', 'pylib')) + process.env.PYTHONPATH = pypath.join(process.platform === 'win32' ? ';' : ':') var cp = gyp.spawn(python, argv) cp.on('exit', onCpExit)