From d0cf9a3b7a29e9345f8f789f691155d84960a6ad Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Tue, 6 May 2025 08:27:21 +0200 Subject: [PATCH] Fixes #109 --- async_substrate_interface/sync_substrate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/async_substrate_interface/sync_substrate.py b/async_substrate_interface/sync_substrate.py index 91986a8..01f5fdb 100644 --- a/async_substrate_interface/sync_substrate.py +++ b/async_substrate_interface/sync_substrate.py @@ -532,8 +532,10 @@ def __enter__(self): return self def __del__(self): - self.ws.close() - print("DELETING SUBSTATE") + try: + self.ws.close() + except AttributeError: + pass # self.ws.protocol.fail(code=1006) # ABNORMAL_CLOSURE def initialize(self):