diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2024-12-17 15:59:26 +0000 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2024-12-17 19:39:53 +0100 |
commit | dd6dfc012c914d3e81be1da4b0ca7328949bdd08 (patch) | |
tree | c2e77cb3c35644b28bd547075cbc4f7d7c030328 | |
parent | 0da341a78f00d6feae98f38d1dfbe2e9f88d0b93 (diff) | |
download | qemu-dd6dfc012c914d3e81be1da4b0ca7328949bdd08.zip qemu-dd6dfc012c914d3e81be1da4b0ca7328949bdd08.tar.gz qemu-dd6dfc012c914d3e81be1da4b0ca7328949bdd08.tar.bz2 |
tests/functional: simplify 'which' implementation
The 'access' check implies the file exists.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20241217155953.3950506-6-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r-- | tests/functional/qemu_test/cmd.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/functional/qemu_test/cmd.py b/tests/functional/qemu_test/cmd.py index 4106f1e..600e050 100644 --- a/tests/functional/qemu_test/cmd.py +++ b/tests/functional/qemu_test/cmd.py @@ -25,7 +25,7 @@ def which(tool): paths=os.getenv('PATH') for p in paths.split(os.path.pathsep): p = os.path.join(p, tool) - if os.path.exists(p) and os.access(p, os.X_OK): + if os.access(p, os.X_OK): return p return None |