From a6670caf5ee04800d0d2728e4ea26a1ac390ea4d Mon Sep 17 00:00:00 2001 From: itsdeka Date: Tue, 4 Jan 2022 17:30:32 +0100 Subject: [PATCH] Avoid p_sub not initialized issue Thanks to @nkasimova (https://github.com/bitfinexcom/bitfinex-api-py/pull/170) --- bfxapi/websockets/subscription_manager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bfxapi/websockets/subscription_manager.py b/bfxapi/websockets/subscription_manager.py index c90c073..b516867 100644 --- a/bfxapi/websockets/subscription_manager.py +++ b/bfxapi/websockets/subscription_manager.py @@ -62,6 +62,7 @@ class SubscriptionManager: channel = raw_ws_data.get("channel") chan_id = raw_ws_data.get("chanId") key = raw_ws_data.get("key", None) + p_sub = None get_key = "{}_{}".format(channel, key or symbol) if chan_id in self.subscriptions_chanid: # subscription has already existed in the past