mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 06:43:53 -06:00
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>
This commit is contained in:
parent
0da341a78f
commit
dd6dfc012c
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue