[Lldb-commits] [PATCH] D124601: [lldb] Use shutil.which instead of distutils find_executable

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 29 01:41:40 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG14869bd2dfab: [lldb] Use shutil.which instead of distutils find_executable (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124601/new/

https://reviews.llvm.org/D124601

Files:
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/test/Shell/lit.cfg.py


Index: lldb/test/Shell/lit.cfg.py
===================================================================
--- lldb/test/Shell/lit.cfg.py
+++ 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:
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ 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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124601.425988.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220429/24443943/attachment.bin>


More information about the lldb-commits mailing list