[lldb] Use shutil.which in Shell tests find_executable
In build.py we have our own find_executable that looks a lot like the distutils one that I switched to shutil.which. This find_executable isn't quite the same as shutil.which so I've refactored it to call that in the correct way. Note that the path passed to shutil.which is in the form that PATH would be, meaning separators are allowed. ``` >>> shutil.which("gcc", path="/home/david.spickett:/bin") '/bin/gcc' ``` We just need to make sure it doesn't ignore the existing PATH and normalise the result if it does find the binary. The .exe extension is automatically added to the binary name if we are on Windows. Depends on D124601 Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D124604
Loading
Please sign in to comment