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>
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