Skip to content

Commit 6ad8ae0

Browse files
committed
Cleanup client irrespective of whether connection was set
1 parent 88488da commit 6ad8ae0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

python/hopsworks/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from pathlib import Path
2424

2525
from hopsworks.client.exceptions import RestAPIError, ProjectException
26-
from hopsworks import version, constants
26+
from hopsworks import version, constants, client
2727
from hopsworks.connection import Connection
2828

2929
# Needs to run before import of hsml and hsfs
@@ -283,6 +283,7 @@ def _prompt_project(valid_connection, project):
283283

284284
def logout():
285285
global _hw_connection
286-
if type(_hw_connection) is Connection:
286+
if isinstance(_hw_connection, Connection):
287287
_hw_connection.close()
288+
client.stop()
288289
_hw_connection = Connection.connection

python/hopsworks/client/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ def set_python_version(python_version):
6767

6868
def stop():
6969
global _client
70-
_client._close()
70+
if _client:
71+
_client._close()
7172
_client = None

0 commit comments

Comments
 (0)