Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 275057a

Browse files
committed
Allow multiple calls to client .connect()
1 parent 0f6176b commit 275057a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cloudant/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def connect(self):
9595
authentication if necessary.
9696
"""
9797
if self.r_session:
98-
return
98+
self.session_logout()
9999

100100
if self.admin_party:
101101
self.r_session = ClientSession(timeout=self._timeout)
@@ -132,7 +132,9 @@ def disconnect(self):
132132
"""
133133
Ends a client authentication session, performs a logout and a clean up.
134134
"""
135-
self.session_logout()
135+
if self.r_session:
136+
self.session_logout()
137+
136138
self.r_session = None
137139
self.clear()
138140

0 commit comments

Comments
 (0)