Skip to content

Commit de6482e

Browse files
authored
gh-132415: Use shutil.which() in missing_compiler_executable() (#132906)
Replace deprecated distutils.spawn.find_executable() with shutil.which() in missing_compiler_executable() of test.support.
1 parent 6a9bfee commit de6482e

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
@@ -1940,8 +1940,9 @@ def missing_compiler_executable(cmd_names=[]):
19401940
missing.
19411941
19421942
"""
1943-
from setuptools._distutils import ccompiler, sysconfig, spawn
1943+
from setuptools._distutils import ccompiler, sysconfig
19441944
from setuptools import errors
1945+
import shutil
19451946

19461947
compiler = ccompiler.new_compiler()
19471948
sysconfig.customize_compiler(compiler)
@@ -1960,7 +1961,7 @@ def missing_compiler_executable(cmd_names=[]):
19601961
"the '%s' executable is not configured" % name
19611962
elif not cmd:
19621963
continue
1963-
if spawn.find_executable(cmd[0]) is None:
1964+
if shutil.which(cmd[0]) is None:
19641965
return cmd[0]
19651966

19661967

0 commit comments

Comments
 (0)