build: remove Python 2 workaround

Remove workaround for Python 2.

I confirmed that V8 build still works by running `./configure.py &&
make v8`.

PR-URL: https://github.com/nodejs/node/pull/41357
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
This commit is contained in:
Rich Trott 2022-01-01 08:27:27 -08:00 committed by GitHub
parent d0c1176533
commit 5999731d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,12 +14,6 @@ import shutil
import bz2
import io
# 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/.
@ -1859,7 +1853,7 @@ def make_bin_override():
# sys.executable. This directory will be prefixed to the PATH, so that
# other tools that shell out to `python` will use the appropriate python
which_python = which('python')
which_python = shutil.which('python')
if (which_python and
os.path.realpath(which_python) == os.path.realpath(sys.executable)):
return