From 85ffd63f8318b0c1fb39b097a68bc90748c2dfcc Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 28 Jun 2022 16:34:57 -0500 Subject: [PATCH 1/1] PackWriter_remote: init remote_closed in __new__, not __init__ So that it's always set during __del__. Otherwise it might not exist if (for example) __new__ or the superclass methods throw an exception before we get to __init__. Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/bup/client.py b/lib/bup/client.py index 0942be0..5873a8f 100644 --- a/lib/bup/client.py +++ b/lib/bup/client.py @@ -509,6 +509,11 @@ class Client: # FIXME: disentangle this (stop inheriting) from PackWriter class PackWriter_Remote(git.PackWriter): + def __new__(cls, *args, **kwargs): + result = super().__new__(cls) + result.remote_closed = True # supports __del__ + return result + def __init__(self, conn, objcache_maker, suggest_packs, onopen, onclose, ensure_busy, -- 2.39.2