From: Daniel P. Berrangé Date: Tue, 17 Dec 2024 15:59:26 +0000 (+0000) Subject: tests/functional: simplify 'which' implementation X-Git-Tag: v10.0.0-rc0~114^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd6dfc012c914d3e81be1da4b0ca7328949bdd08;p=thirdparty%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 4106f1ee7cf..600e0509db3 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