python: move Python detection to its own file

PR-URL: https://github.com/nodejs/node-gyp/pull/1815
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
João Reis 2019-07-08 16:37:29 +01:00
parent bb92c761a9
commit 7e7fce3fed
3 changed files with 297 additions and 287 deletions

View file

@ -1,16 +1,16 @@
'use strict'
const test = require('tap').test
const configure = require('../lib/configure')
const findPython = require('../lib/find-python')
const execFile = require('child_process').execFile
const PythonFinder = configure.test.PythonFinder
const PythonFinder = findPython.test.PythonFinder
require('npmlog').level = 'warn'
test('find python', function (t) {
t.plan(4)
configure.test.findPython(null, function (err, found) {
findPython.test.findPython(null, function (err, found) {
t.strictEqual(err, null)
var proc = execFile(found, ['-V'], function (err, stdout, stderr) {
t.strictEqual(err, null)