Skip to content

Commit 50703bd

Browse files
committed
Fix unclosed aiohttp.ClientSession during __del__
1 parent e80c97e commit 50703bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/zeep/asyncio/transport.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def __init__(self, loop, cache=None, timeout=300, operation_timeout=None,
4646

4747
def __del__(self):
4848
if self._close_session:
49-
self.session.close()
49+
# aiohttp.ClientSession.close() is async,
50+
# call the underlying sync function instead.
51+
self.session.connector.close()
5052

5153
def _load_remote_data(self, url):
5254
result = None

0 commit comments

Comments
 (0)