mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
Re-raise keyboardinterrupt (#2603)
This commit is contained in:
parent
5be52f71f9
commit
ff2c316b18
1 changed files with 4 additions and 2 deletions
|
@ -192,8 +192,8 @@ def run_external_command(
|
||||||
sys.argv = list(cmd)
|
sys.argv = list(cmd)
|
||||||
sys.exit = mock_exit
|
sys.exit = mock_exit
|
||||||
return func() or 0
|
return func() or 0
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt: # pylint: disable=try-except-raise
|
||||||
return 1
|
raise
|
||||||
except SystemExit as err:
|
except SystemExit as err:
|
||||||
return err.args[0]
|
return err.args[0]
|
||||||
except Exception as err: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
|
@ -227,6 +227,8 @@ def run_external_process(*cmd, **kwargs):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return subprocess.call(cmd, stdout=sub_stdout, stderr=sub_stderr)
|
return subprocess.call(cmd, stdout=sub_stdout, stderr=sub_stderr)
|
||||||
|
except KeyboardInterrupt: # pylint: disable=try-except-raise
|
||||||
|
raise
|
||||||
except Exception as err: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
_LOGGER.error("Running command failed: %s", err)
|
_LOGGER.error("Running command failed: %s", err)
|
||||||
_LOGGER.error("Please try running %s locally.", full_cmd)
|
_LOGGER.error("Please try running %s locally.", full_cmd)
|
||||||
|
|
Loading…
Reference in a new issue