Re-raise keyboardinterrupt (#2603)

This commit is contained in:
Otto Winter 2021-10-22 14:14:07 +02:00 committed by GitHub
parent 0d90ef94ae
commit b5b3914bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,8 +192,8 @@ def run_external_command(
sys.argv = list(cmd)
sys.exit = mock_exit
return func() or 0
except KeyboardInterrupt:
return 1
except KeyboardInterrupt: # pylint: disable=try-except-raise
raise
except SystemExit as err:
return err.args[0]
except Exception as err: # pylint: disable=broad-except
@ -227,6 +227,8 @@ def run_external_process(*cmd, **kwargs):
try:
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
_LOGGER.error("Running command failed: %s", err)
_LOGGER.error("Please try running %s locally.", full_cmd)