diff --git a/src/openai/_base_client.py b/src/openai/_base_client.py index 10d7b9f7ca..90ae56b7cc 100644 --- a/src/openai/_base_client.py +++ b/src/openai/_base_client.py @@ -894,7 +894,7 @@ def __del__(self) -> None: try: self.close() except Exception: - pass + pass # best-effort; __del__ may run during interpreter teardown class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]): @@ -1520,7 +1520,7 @@ def __del__(self) -> None: # TODO(someday): support non asyncio runtimes here asyncio.get_running_loop().create_task(self.aclose()) except Exception: - pass + pass # expected when no event loop is running (GC / interpreter shutdown) class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):