From f1c2efa4a19f601bd1a8b6406f76809c3ff085a1 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 5 Jan 2024 09:36:02 +0000 Subject: [PATCH] adds disconnect() method to ReqClient now calling disconnect() in __exit__() --- obsws_python/reqs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obsws_python/reqs.py b/obsws_python/reqs.py index 2cef993..9c14895 100644 --- a/obsws_python/reqs.py +++ b/obsws_python/reqs.py @@ -31,7 +31,7 @@ class ReqClient: return self def __exit__(self, exc_type, exc_value, exc_traceback): - self.base_client.ws.close() + self.disconnect() def __repr__(self): return type( @@ -42,6 +42,9 @@ class ReqClient: def __str__(self): return type(self).__name__ + + def disconnect(self): + self.base_client.ws.close() def send(self, param, data=None, raw=False): try: