Skip to content

Commit 949aafa

Browse files
dmontaguDouweM
andauthored
Fix a bug with task group cancellation nonsense (#3338)
Co-authored-by: Douwe Maan <douwe@pydantic.dev>
1 parent 6a153c8 commit 949aafa

File tree

5 files changed

+997
-171
lines changed

5 files changed

+997
-171
lines changed

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,9 @@ async def client_streams(
726726
MemoryObjectReceiveStream[SessionMessage | Exception],
727727
MemoryObjectSendStream[SessionMessage],
728728
]
729-
]: # pragma: no cover
729+
]:
730730
if self.http_client and self.headers:
731-
raise ValueError('`http_client` is mutually exclusive with `headers`.')
731+
raise ValueError('`http_client` is mutually exclusive with `headers`.') # pragma: no cover
732732

733733
transport_client_partial = functools.partial(
734734
self._transport_client,
@@ -737,7 +737,7 @@ async def client_streams(
737737
sse_read_timeout=self.read_timeout,
738738
)
739739

740-
if self.http_client is not None:
740+
if self.http_client is not None: # pragma: no cover
741741

742742
def httpx_client_factory(
743743
headers: dict[str, str] | None = None,
@@ -866,7 +866,7 @@ def __get_pydantic_core_schema__(cls, _: Any, __: Any) -> CoreSchema:
866866

867867
@property
868868
def _transport_client(self):
869-
return streamablehttp_client # pragma: no cover
869+
return streamablehttp_client
870870

871871
def __eq__(self, value: object, /) -> bool:
872872
return super().__eq__(value) and isinstance(value, MCPServerStreamableHTTP) and self.url == value.url

0 commit comments

Comments
 (0)