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 <[email protected]>
Fixes: #34699

PR-URL: #34700
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ricky Zhou <[email protected]>
  • Loading branch information
addaleax committed Sep 22, 2020
1 parent f29ab40 commit 9cde4eb
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 9cde4eb

Please sign in to comment.