Skip to content

Commit 1741877

Browse files
Remove unsafe async client cleanup in __del__
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 1e17aea commit 1741877

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

hyperbrowser/transport/async_transport.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import httpx
32
from typing import Optional
43

@@ -31,14 +30,6 @@ async def __aenter__(self):
3130
async def __aexit__(self, exc_type, exc_val, exc_tb):
3231
await self.close()
3332

34-
def __del__(self):
35-
if not self._closed:
36-
try:
37-
loop = asyncio.get_running_loop()
38-
loop.create_task(self.client.aclose())
39-
except Exception:
40-
pass
41-
4233
async def _handle_response(self, response: httpx.Response) -> APIResponse:
4334
try:
4435
response.raise_for_status()

0 commit comments

Comments
 (0)