Skip to content

Commit 3ebcf62

Browse files
vstinnermiss-islington
authored andcommitted
gh-132415: Use shutil.which() in missing_compiler_executable() (GH-132906)
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 <[email protected]>
1 parent 8a759c2 commit 3ebcf62

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
@@ -1893,8 +1893,9 @@ def missing_compiler_executable(cmd_names=[]):
18931893
missing.
18941894
18951895
"""
1896-
from setuptools._distutils import ccompiler, sysconfig, spawn
1896+
from setuptools._distutils import ccompiler, sysconfig
18971897
from setuptools import errors
1898+
import shutil
18981899

18991900
compiler = ccompiler.new_compiler()
19001901
sysconfig.customize_compiler(compiler)
@@ -1913,7 +1914,7 @@ def missing_compiler_executable(cmd_names=[]):
19131914
"the '%s' executable is not configured" % name
19141915
elif not cmd:
19151916
continue
1916-
if spawn.find_executable(cmd[0]) is None:
1917+
if shutil.which(cmd[0]) is None:
19171918
return cmd[0]
19181919

19191920

0 commit comments

Comments
 (0)