mirror of https://github.com/python/cpython
bpo-41172: Fix check for compiler in test suite (GH-21400)
This commit is contained in:
parent
8b33961e4b
commit
af56c4fc76
|
@ -1673,9 +1673,15 @@ def missing_compiler_executable(cmd_names=[]):
|
|||
missing.
|
||||
|
||||
"""
|
||||
from distutils import ccompiler, sysconfig, spawn
|
||||
from distutils import ccompiler, sysconfig, spawn, errors
|
||||
compiler = ccompiler.new_compiler()
|
||||
sysconfig.customize_compiler(compiler)
|
||||
if compiler.compiler_type == "msvc":
|
||||
# MSVC has no executables, so check whether initialization succeeds
|
||||
try:
|
||||
compiler.initialize()
|
||||
except errors.DistutilsPlatformError:
|
||||
return "msvc"
|
||||
for name in compiler.executables:
|
||||
if cmd_names and name not in cmd_names:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue