From: Jérémy Lal Date: Sat, 8 Aug 2020 12:09:43 +0000 (+0100) Subject: support build with python3 X-Git-Tag: archive/raspbian/18.12.1+dfsg-2+rpi1~1^2^2^2^2^2^2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=763a9432f37895ed4df51707c4c0106aa0cd545d;p=nodejs.git support build with python3 Forwarded: not-needed Last-Update: 2020-08-08 Gbp-Pq: Name python3.patch --- diff --git a/configure b/configure index 9156e13f7..440938b04 100755 --- a/configure +++ b/configure @@ -4,7 +4,7 @@ # mix of single and double quotes is intentional, as is the fact that # the ] goes on a new line. _=[ 'exec' '/bin/sh' '-c' ''' -which python2.7 >/dev/null && exec python2.7 "$0" "$@" +which python3 >/dev/null && exec python3 "$0" "$@" which python2 >/dev/null && exec python2 "$0" "$@" exec python "$0" "$@" ''' "$0" "$@" @@ -13,16 +13,5 @@ del _ import sys from distutils.spawn import find_executable as which -if sys.version_info[:2] != (2, 7): - sys.stderr.write('Please use Python 2.7') - - python2 = which('python2') or which('python2.7') - - if python2: - sys.stderr.write(':\n\n') - sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv)) - - sys.stderr.write('\n') - sys.exit(1) import configure diff --git a/test/parallel/test-child-process-set-blocking.js b/test/parallel/test-child-process-set-blocking.js index b78b71e54..1db27ca6c 100644 --- a/test/parallel/test-child-process-set-blocking.js +++ b/test/parallel/test-child-process-set-blocking.js @@ -26,7 +26,8 @@ const ch = require('child_process'); const SIZE = 100000; -const cp = ch.spawn('python', ['-c', `print(${SIZE} * "C")`], { +const python = process.env.PYTHON || 'python'; +const cp = ch.spawn(python, ['-c', `print(${SIZE} * "C")`], { stdio: 'inherit' }); diff --git a/test/pummel/test-child-process-spawn-loop.js b/test/pummel/test-child-process-spawn-loop.js index f6d8207df..b7df0b6e4 100644 --- a/test/pummel/test-child-process-spawn-loop.js +++ b/test/pummel/test-child-process-spawn-loop.js @@ -30,7 +30,8 @@ const N = 40; let finished = false; function doSpawn(i) { - const child = spawn('python', ['-c', `print ${SIZE} * "C"`]); + const python = process.env.PYTHON || 'python'; + const child = spawn(python, ['-c', `print ${SIZE} * "C"`]); let count = 0; child.stdout.setEncoding('ascii');