Skip to content

Commit 570c623

Browse files
committed
Fix the __exit__ clause
Not the best fix, but it works
1 parent 4388ddd commit 570c623

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/zeep/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ def __enter__(self):
218218
return self
219219

220220
def __exit__(self, exc_type=None, exc_value=None, traceback=None):
221-
self.transport.close()
221+
if hasattr(self.transport, "close"):
222+
self.transport.close()
222223

223224

224225
class AsyncClient(Client):

0 commit comments

Comments
 (0)