Skip to content

Commit d43cb4f

Browse files
[3.12] gh-132415: Use shutil.which() in missing_compiler_executable() (GH-132906) (GH-135392)
Replace deprecated distutils.spawn.find_executable() with shutil.which() in missing_compiler_executable() of test.support. (cherry picked from commit de6482e) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent fd6c5fe commit d43cb4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/support/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,8 +1804,9 @@ def missing_compiler_executable(cmd_names=[]):
18041804
missing.
18051805
18061806
"""
1807-
from setuptools._distutils import ccompiler, sysconfig, spawn
1807+
from setuptools._distutils import ccompiler, sysconfig
18081808
from setuptools import errors
1809+
import shutil
18091810

18101811
compiler = ccompiler.new_compiler()
18111812
sysconfig.customize_compiler(compiler)
@@ -1824,7 +1825,7 @@ def missing_compiler_executable(cmd_names=[]):
18241825
"the '%s' executable is not configured" % name
18251826
elif not cmd:
18261827
continue
1827-
if spawn.find_executable(cmd[0]) is None:
1828+
if shutil.which(cmd[0]) is None:
18281829
return cmd[0]
18291830

18301831

0 commit comments

Comments
 (0)