From 80de2602c483b94f422401272d3574ed4d90624b Mon Sep 17 00:00:00 2001 From: DoronZ Date: Thu, 17 Feb 2022 11:31:04 +0200 Subject: [PATCH] allocated: bugfix: ignore errors from __del__ --- src/rpcclient/rpcclient/allocated.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rpcclient/rpcclient/allocated.py b/src/rpcclient/rpcclient/allocated.py index f6f73d26..18f2096b 100644 --- a/src/rpcclient/rpcclient/allocated.py +++ b/src/rpcclient/rpcclient/allocated.py @@ -14,7 +14,10 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.deallocate() def __del__(self): - self.deallocate() + try: + self.deallocate() + except Exception: + pass @abstractmethod def _deallocate(self):