From 3eb9432cd201588add8387711601dd1be50361d2 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 24 Apr 2018 01:24:42 +0000 Subject: [PATCH] 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 --- utils/lit/lit/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/lit/lit/util.py b/utils/lit/lit/util.py index 8d4d9d25b19..e20c4ab9015 100644 --- a/utils/lit/lit/util.py +++ b/utils/lit/lit/util.py @@ -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 -- 2.11.0