diff options
author | Richard Lau <rlau@redhat.com> | 2021-05-06 01:48:14 +0300 |
---|---|---|
committer | Richard Lau <rlau@redhat.com> | 2021-05-10 17:34:12 +0300 |
commit | 16982b6c4d7c384c69b25bc2569eb76d5fbeb4c1 (patch) | |
tree | f5d451cb08f5dad84e82f7dfdf896242c8c613f9 /configure.py | |
parent | 63155c95ba6fdb8f5c93223a786056308d302f2f (diff) |
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: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/configure.py b/configure.py index 6798b4a445c..b877319841e 100755 --- a/configure.py +++ b/configure.py @@ -14,7 +14,7 @@ import shutil import bz2 import io -from distutils.spawn import find_executable as which +from shutil import which from distutils.version import StrictVersion # If not run from node/, cd to node/. |