Unverified Commit 16982b6c authored by Richard Lau's avatar Richard Lau
Browse files

build: remove dependency on `distutils.spawn`

Debian based packages of Python 3 do not include `distutils.spawn` and
require an additional apt package to be installed (`python3-distutils`).
Replace use of `distutils.spawn` with `shutil.which`, available in all
versions of Python currently allowed by our configure scripts.

For the `configure` script only, fall back to `distutils.spawn` to allow
friendlier error messages when run on older unsupported versions of
Python (e.g. 2.7).

`configure.py` also uses `distutils.version` -- this appears to be
available in Debian packaged Python 3 without installing
`python3-distutils` so has been left as-is.

PR-URL: https://github.com/nodejs/node/pull/38600
Refs: https://github.com/nodejs/node/issues/30189


Reviewed-By: default avatarDarshan Sen <raisinten@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarChristian Clauss <cclauss@me.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 63155c95
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment