Skip to content

Commit

Permalink
test: use process.env.PYTHON to spawn python
Browse files Browse the repository at this point in the history
Co-authored-by: Jérémy Lal <kapouer@melix.org>
Fixes: #34699

PR-URL: #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>
  • Loading branch information
addaleax authored and rickyes committed Aug 14, 2020
1 parent a0f87aa commit 888eb5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/parallel/test-child-process-set-blocking.js
Expand Up @@ -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'
});

Expand Down
3 changes: 2 additions & 1 deletion test/pummel/test-child-process-spawn-loop.js
Expand Up @@ -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');
Expand Down

0 comments on commit 888eb5a

Please sign in to comment.