Skip to content

Commit

Permalink
Fix ping() in case of no connection established yet
Browse files Browse the repository at this point in the history
Otherwise timeout_setter() will try to call gettimeout() of None.
  • Loading branch information
azat committed Dec 9, 2024
1 parent 8a4e7c5 commit 39e6b63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clickhouse_driver/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,9 @@ def send_addendum(self):
)

def ping(self):
if not self.socket:
return None

timeout = self.sync_request_timeout

with self.timeout_setter(timeout):
Expand Down

0 comments on commit 39e6b63

Please sign in to comment.