From 3edb200656e7151bb0bba83525cbf48452a432e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20H=C3=A1la?= Date: Thu, 6 Apr 2023 19:27:25 +0200 Subject: [PATCH] fix: Check if _s exists in ConnectionManager before deleting it (#429) --- src/keycloak/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/keycloak/connection.py b/src/keycloak/connection.py index fcdffb4..3134676 100644 --- a/src/keycloak/connection.py +++ b/src/keycloak/connection.py @@ -86,7 +86,8 @@ class ConnectionManager(object): def __del__(self): """Del method.""" - self._s.close() + if hasattr(self, "_s"): + self._s.close() @property def base_url(self):