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 4545 import grpc as _grpc
4646
4747 _AioRpcError : Any = _grpc .aio .AioRpcError
48- _RETRYABLE_GRPC_CODES : frozenset [Any ] = frozenset ({
49- _grpc .StatusCode .UNAVAILABLE ,
50- _grpc .StatusCode .RESOURCE_EXHAUSTED ,
51- })
48+ _RETRYABLE_GRPC_CODES : frozenset [Any ] = frozenset (
49+ {
50+ _grpc .StatusCode .UNAVAILABLE ,
51+ _grpc .StatusCode .RESOURCE_EXHAUSTED ,
52+ }
53+ )
5254except ImportError :
5355 _AioRpcError = None
5456 _RETRYABLE_GRPC_CODES = frozenset ()
@@ -79,7 +81,7 @@ def default_retry_predicate(error: Exception) -> bool: # noqa: PLR0911
7981 if isinstance (cause , httpx .RequestError ):
8082 return True
8183 if _AioRpcError is not None and isinstance (cause , _AioRpcError ):
82- return cause .code () in _RETRYABLE_GRPC_CODES
84+ return cause .code () in _RETRYABLE_GRPC_CODES # pyright: ignore[reportAttributeAccessIssue]
8385 return False
8486
8587
Original file line number Diff line number Diff line change @@ -632,10 +632,13 @@ async def test_cancelled_error_during_sleep_propagates(
632632 async def cancelling_sleep (* _args : object , ** _kwargs : object ) -> None :
633633 raise asyncio .CancelledError
634634
635- with patch (
636- 'a2a.client.transports.retry.asyncio.sleep' ,
637- side_effect = cancelling_sleep ,
638- ), pytest .raises (asyncio .CancelledError ):
635+ with (
636+ patch (
637+ 'a2a.client.transports.retry.asyncio.sleep' ,
638+ side_effect = cancelling_sleep ,
639+ ),
640+ pytest .raises (asyncio .CancelledError ),
641+ ):
639642 await transport .send_message (SendMessageRequest ())
640643
641644 # First attempt ran; cancel hit on the sleep before the second.
You can’t perform that action at this time.
0 commit comments