From 5df0f35bf6e9cd556e6223a351535e90a8fecfb3 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 11 May 2021 06:03:37 -0400 Subject: [PATCH] build: add workaround for V8 builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit V8's build toolchain is not compatible with Python 3 and the CI job that tests V8 needs to be run with Python 2. Add a fallback to `find_executable` from `distutils.spawn` to allow the configure script to run in the V8 test job. PR-URL: https://github.com/nodejs/node/pull/38632 Reviewed-By: Michaƫl Zasso Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Rich Trott --- configure.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index a9bf9af68b0643..c56559626df228 100755 --- a/configure.py +++ b/configure.py @@ -14,7 +14,12 @@ import bz2 import io -from shutil import which +# Fallback to find_executable from distutils.spawn is a stopgap for +# supporting V8 builds, which do not yet support Python 3. +try: + from shutil import which +except ImportError: + from distutils.spawn import find_executable as which from distutils.version import StrictVersion # If not run from node/, cd to node/.