test: use process.env.PYTHON to spawn python

Co-authored-by: Jérémy Lal <kapouer@melix.org>
Fixes: https://github.com/nodejs/node/issues/34699

PR-URL: https://github.com/nodejs/node/pull/34700
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
This commit is contained in:
Anna HenningsenandJérémy Lal committed 2020-09-22 19:55:34 +02:00
1 parent f29ab4092f
commit 9cde4eb73a
2 files changed
+4 -2

No files matched your search

@@ -25,8 +25,9 @@ const assert = require('assert');
const ch = require('child_process');
const SIZE = 100000;
const python = process.env.PYTHON || 'python';
const cp = ch.spawn('python', ['-c', `print(${SIZE} * "C")`], {
const cp = ch.spawn(python, ['-c', `print(${SIZE} * "C")`], {
stdio: 'inherit'
});
+2 -1
View File
@@ -24,13 +24,14 @@ const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;
const python = process.env.PYTHON || 'python';
const SIZE = 1000 * 1024;
const N = 40;
let finished = false;
function doSpawn(i) {
const child = spawn('python', ['-c', `print(${SIZE} * "C")`]);
const child = spawn(python, ['-c', `print(${SIZE} * "C")`]);
let count = 0;
child.stdout.setEncoding('ascii');