mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
6a9bfee4fa
commit
de6482eda3
1 changed files with 3 additions and 2 deletions
|
@ -1940,8 +1940,9 @@ def missing_compiler_executable(cmd_names=[]):
|
|||
missing.
|
||||
|
||||
"""
|
||||
from setuptools._distutils import ccompiler, sysconfig, spawn
|
||||
from setuptools._distutils import ccompiler, sysconfig
|
||||
from setuptools import errors
|
||||
import shutil
|
||||
|
||||
compiler = ccompiler.new_compiler()
|
||||
sysconfig.customize_compiler(compiler)
|
||||
|
@ -1960,7 +1961,7 @@ def missing_compiler_executable(cmd_names=[]):
|
|||
"the '%s' executable is not configured" % name
|
||||
elif not cmd:
|
||||
continue
|
||||
if spawn.find_executable(cmd[0]) is None:
|
||||
if shutil.which(cmd[0]) is None:
|
||||
return cmd[0]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue