1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 09:19:31 +00:00

close the repo on exit - even if rollback did not work, fixes #1197

This commit is contained in:
Thomas Waldmann 2016-07-03 02:58:17 +02:00
parent 9ae1351bec
commit 9725c03299

View file

@ -189,8 +189,13 @@ def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
try:
if exc_type is not None:
self.rollback()
finally:
# in any case, we want to cleanly close the repo, even if the
# rollback can not succeed (e.g. because the connection was
# already closed) and raised another exception:
self.close()
def borg_cmd(self, args, testing):