From 85bc7222c34c301e3cf2672ce97641d0d72d67ad Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Thu, 25 Nov 2021 12:56:10 +0200 Subject: [PATCH] git: close PackIdxList on init failures Signed-off-by: Johannes Berg Reviewed-by: Rob Browning [rlb@defaultvalue.org: use pending_raise] Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/git.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bup/git.py b/lib/bup/git.py index c038fd1..3608f18 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -539,7 +539,11 @@ class PackIdxList: self.do_bloom = False self.bloom = None self.ignore_midx = ignore_midx - self.refresh() + try: + self.refresh() + except BaseException as ex: + with pending_raise(ex): + self.close() def close(self): global _mpi_count -- 2.39.2