diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-09-08 12:07:24 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-09-08 12:07:24 +0000 |
commit | 46b4b112d23cdec5d27e2ebf70fc492be3786316 (patch) | |
tree | 7028f0d47c0412db9e063a7cfe67d80497b5f8c7 /utils/lit | |
parent | cacd9d6f7974dd54e8b7a758c1fc3b69ec7c5d4b (diff) |
lit: Util.which(): Use os.path.isfile() instead of os.path.exists(), or it hits to the directory.
For example, which('loop-convert') returns 'loop-convert' when the directory 'loop-convert' exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit')
-rw-r--r-- | utils/lit/lit/Util.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/lit/lit/Util.py b/utils/lit/lit/Util.py index 226e453f28..f29480900c 100644 --- a/utils/lit/lit/Util.py +++ b/utils/lit/lit/Util.py @@ -56,7 +56,7 @@ def which(command, paths = None): paths = os.environ.get('PATH','') # Check for absolute match first. - if os.path.exists(command): + if os.path.isfile(command): return command # Would be nice if Python had a lib function for this. |