From dd6dfc012c914d3e81be1da4b0ca7328949bdd08 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 17 Dec 2024 15:59:26 +0000 Subject: [PATCH] tests/functional: simplify 'which' implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- tests/functional/qemu_test/cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.30.2