]> arthur.barton.de Git - bup.git/commitdiff
PackWriter_Remote.close: call parent close
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 5 Dec 2021 20:19:52 +0000 (21:19 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sat, 1 Jan 2022 18:59:38 +0000 (12:59 -0600)
We weren't explicitly closing the PackWriter, and __del__ no longer
does either.  Make PackWriter a "new style" object so that the super()
call will also work with python 2.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: split from larger commit; adjust commit message]
[rlb@defaultvalue.org: convert PackWriter to "new style" object]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/client.py
lib/bup/git.py

index 7c284c4af4aa613db536cf5db637382988e1db02..7dcf02b2582eb2202cfb6a51054cc35474c6fc2c 100644 (file)
@@ -537,6 +537,7 @@ class PackWriter_Remote(git.PackWriter):
         self.remote_closed = True
         id = self._end()
         self.file = None
+        super(PackWriter_Remote, self).close()
         return id
 
     def __del__(self):
index 73a50b88773f6585c01e264775cfe9a91c0bd120..26bdf6d5a303d8dd7041b94bc0c317d7db6535b9 100644 (file)
@@ -772,7 +772,7 @@ def _make_objcache():
 # bup-gc assumes that it can disable all PackWriter activities
 # (bloom/midx/cache) via the constructor and close() arguments.
 
-class PackWriter:
+class PackWriter(object):
     """Writes Git objects inside a pack file."""
     def __init__(self, objcache_maker=_make_objcache, compression_level=1,
                  run_midx=True, on_pack_finish=None,