Kill storage hook on error

This commit is contained in:
Unrud 2020-08-31 13:54:48 +02:00
parent dbe95641c0
commit d4af2cd1a6

View File

@ -62,7 +62,11 @@ class StorageLockMixin:
stdout=subprocess.PIPE if debug else subprocess.DEVNULL,
stderr=subprocess.PIPE if debug else subprocess.DEVNULL,
shell=True, universal_newlines=True, cwd=folder)
stdout_data, stderr_data = p.communicate()
try:
stdout_data, stderr_data = p.communicate()
except BaseException: # e.g. KeyboardInterrupt or SystemExit
p.kill()
raise
if stdout_data:
logger.debug("Captured stdout hook:\n%s", stdout_data)
if stderr_data: