From 7c08b85c5af05fc4eceed37f08870a2ab32ea1d9 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Tue, 12 Jul 2016 15:39:24 -0400 Subject: [PATCH] Revert "configure: use "path-array" for PYTHONPATH" This reverts commit ff88e5fd1211877a9a6eb2a906f7e4d4ff377604. Of the 5.5MB footprint of node-gyp, path-array makes up 3.6MB. Removing this reduces the weight of npm (and thus node) appreciably. PR-URL: https://github.com/nodejs/node-gyp/pull/990 Reviewed-By: Ben Noordhuis --- lib/configure.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)