From: Johannes Berg Date: Sun, 5 Dec 2021 20:19:52 +0000 (+0100) Subject: PackWriter_Remote.close: call parent close X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=0dc1dbaabb0edc9e336e506707446bc4dbc67b1a;p=bup.git PackWriter_Remote.close: call parent close 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 Reviewed-by: Rob Browning [rlb@defaultvalue.org: split from larger commit; adjust commit message] [rlb@defaultvalue.org: convert PackWriter to "new style" object] Signed-off-by: Rob Browning Tested-by: Rob Browning --- diff --git a/lib/bup/client.py b/lib/bup/client.py index 7c284c4..7dcf02b 100644 --- a/lib/bup/client.py +++ b/lib/bup/client.py @@ -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): diff --git a/lib/bup/git.py b/lib/bup/git.py index 73a50b8..26bdf6d 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -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,