]> arthur.barton.de Git - bup.git/commitdiff
git: close PackIdxList on init failures
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 25 Nov 2021 10:56:10 +0000 (12:56 +0200)
committerRob Browning <rlb@defaultvalue.org>
Sun, 5 Dec 2021 20:26:40 +0000 (14:26 -0600)
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: use pending_raise]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/git.py

index c038fd1587b2abeb5ea920db7e476cf32194de92..3608f183715d4981f1dacb11adcd93a6c56817ae 100644 (file)
@@ -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