tools: Command: Fix always-True validation in ctor

Instead of testing the truthiness of the method (always True), call it.

BUG=b:233346153
TEST=tools/dev_container bash -c 'echo Hello'
Change-Id: I761d848ea3811ff721420de8f4b626e11288acee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3649552
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Pierre-Clément Tosi 2022-05-20 13:24:51 +01:00 committed by Chromeos LUCI
parent 8736f39fe5
commit d28162f170

View file

@ -126,7 +126,7 @@ class Command(object):
self.env_vars = env_vars self.env_vars = env_vars
if len(self.args) > 0: if len(self.args) > 0:
executable = self.args[0] executable = self.args[0]
if Path(executable).exists: if Path(executable).exists():
self.executable = Path(executable) self.executable = Path(executable)
else: else:
path = shutil.which(executable) path = shutil.which(executable)