From: Daniel P. Berrangé Date: Tue, 17 Dec 2024 15:59:26 +0000 (+0000) Subject: tests/functional: simplify 'which' implementation X-Git-Tag: pull-vmclock-20250108~17^2~33 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dd6dfc012c914d3e81be1da4b0ca7328949bdd08;p=users%2Fdwmw2%2Fqemu.git tests/functional: simplify 'which' implementation The 'access' check implies the file exists. Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Daniel P. Berrangé Message-ID: <20241217155953.3950506-6-berrange@redhat.com> Signed-off-by: Thomas Huth --- diff --git a/tests/functional/qemu_test/cmd.py b/tests/functional/qemu_test/cmd.py index 4106f1ee7c..600e0509db 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