1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

Fix return value of run_external_command (#5657)

This commit is contained in:
Jesse Hills
2023-11-02 17:06:09 +13:00
committed by GitHub
parent f70d651a39
commit 4edf3efdf3

View File

@@ -222,7 +222,7 @@ def run_external_command(
try:
sys.argv = list(cmd)
sys.exit = mock_exit
return func() or 0
retval = func() or 0
except KeyboardInterrupt: # pylint: disable=try-except-raise
raise
except SystemExit as err:
@@ -239,9 +239,10 @@ def run_external_command(
sys.stderr = orig_stderr
if capture_stdout:
# pylint: disable=lost-exception
return cap_stdout.getvalue()
return retval
def run_external_process(*cmd, **kwargs):
full_cmd = " ".join(shlex_quote(x) for x in cmd)