Skip to content

Commit a74dc65

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: typing in AsyncClient.__aexit__, __exit__.
PiperOrigin-RevId: 902717201
1 parent ac1b3e9 commit a74dc65

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

google/genai/client.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
import asyncio
1717
import os
18-
from types import TracebackType
19-
from typing import Optional, Union
18+
from typing import Any, Optional, Union
2019

2120
import google.auth
2221
import pydantic
@@ -284,12 +283,8 @@ async def aclose(self) -> None:
284283
async def __aenter__(self) -> 'AsyncClient':
285284
return self
286285

287-
async def __aexit__(
288-
self,
289-
exc_type: Optional[Exception],
290-
exc_value: Optional[Exception],
291-
traceback: Optional[TracebackType],
292-
) -> None:
286+
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
287+
del args, kwargs
293288
await self.aclose()
294289

295290
def __del__(self) -> None:
@@ -640,12 +635,8 @@ def close(self) -> None:
640635
def __enter__(self) -> 'Client':
641636
return self
642637

643-
def __exit__(
644-
self,
645-
exc_type: Optional[Exception],
646-
exc_value: Optional[Exception],
647-
traceback: Optional[TracebackType],
648-
) -> None:
638+
def __exit__(self, *args: Any, **kwargs: Any) -> None:
639+
del args, kwargs
649640
self.close()
650641

651642
def __del__(self) -> None:

0 commit comments

Comments
 (0)