1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Kill storage hook on error

This commit is contained in:
Unrud 2020-08-31 13:54:48 +02:00
parent 0f74257eae
commit 3a4a7eb3e4

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: