Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/openai/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,9 @@ def __del__(self) -> None:
try:
self.close()
except Exception:
pass
# Suppress destructor cleanup errors; object finalizers should not raise
# during garbage collection or interpreter shutdown.
return


class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
Expand Down Expand Up @@ -1434,7 +1436,9 @@ def __del__(self) -> None:
# TODO(someday): support non asyncio runtimes here
asyncio.get_running_loop().create_task(self.aclose())
except Exception:
pass
# Suppress destructor cleanup errors; object finalizers should not raise
# during garbage collection or interpreter shutdown.
return


class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
Expand Down