Skip to content

Commit

Permalink
Improve status checks before closing underlying connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Nov 3, 2023
1 parent 500fc32 commit 4964bc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exasol/driver/websocket/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ def connection(self):

def close(self):
"""See also :py:meth: `Connection.close`"""
if not self._connection:
if self._connection is None or self._connection.is_closed:
return
try:
self._connection.close()
except Exception as ex:
raise Error() from ex
self._connection = None

@_requires_connection
def commit(self):
Expand Down

0 comments on commit 4964bc2

Please sign in to comment.