Mostly revert r330672.

The test is apparently needed e.g. for check-cfi on Windows where we get
  'C:/b/slave/sanitizer-windows/build/./bin/clang.exe': command not found
without it.  Try to fix the problem that was fixed by r330672 by also checking
for isabs() instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nico Weber 2018-04-24 01:24:42 +00:00
parent bdd8ac7826
commit 3eb9432cd2

View File

@ -193,6 +193,10 @@ def which(command, paths=None):
if paths is None:
paths = os.environ.get('PATH', '')
# Check for absolute match first.
if os.path.isabs(command) and os.path.isfile(command):
return os.path.normpath(command)
# Would be nice if Python had a lib function for this.
if not paths:
paths = os.defpath