File tree Expand file tree Collapse file tree
src/a2a/client/transports Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33from abc import ABC , abstractmethod
44from collections .abc import AsyncGenerator , Callable
5+ from typing import TYPE_CHECKING
6+
7+ from typing_extensions import Self
8+
9+
10+ if TYPE_CHECKING :
11+ from types import TracebackType
512
613from a2a .client .middleware import ClientCallContext
714from a2a .types import (
2128class ClientTransport (ABC ):
2229 """Abstract base class for a client transport."""
2330
24- async def __aenter__ (self ) -> ClientTransport :
31+ async def __aenter__ (self ) -> Self :
2532 """Enter the async context manager, returning the transport itself."""
2633 return self
2734
2835 async def __aexit__ (
2936 self ,
3037 exc_type : type [BaseException ] | None ,
3138 exc_val : BaseException | None ,
32- exc_tb : object | None ,
39+ exc_tb : TracebackType | None ,
3340 ) -> None :
3441 """Exit the async context manager, ensuring close() is called."""
3542 await self .close ()
You can’t perform that action at this time.
0 commit comments