diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -49,7 +49,6 @@ import sys import time import traceback -import distutils.spawn # Third-party modules import unittest2 @@ -1568,7 +1567,7 @@ # Tries to find clang at the same folder as the lldb lldb_dir = os.path.dirname(lldbtest_config.lldbExec) - path = distutils.spawn.find_executable("clang", lldb_dir) + path = shutil.which("clang", path=lldb_dir) if path is not None: return path diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py --- a/lldb/test/Shell/lit.cfg.py +++ b/lldb/test/Shell/lit.cfg.py @@ -12,7 +12,6 @@ from lit.llvm import llvm_config from lit.llvm.subst import FindTool from lit.llvm.subst import ToolSubst -from distutils.spawn import find_executable site.addsitedir(os.path.dirname(__file__)) from helper import toolchain @@ -121,7 +120,7 @@ if config.lldb_enable_lzma: config.available_features.add('lzma') -if find_executable('xz') != None: +if shutil.which('xz') != None: config.available_features.add('xz') if config.lldb_system_debugserver: