Skip to content

Commit b0b44c2

Browse files
authored
Use total_seconds instead of seconds on timeout (#896)
1 parent 7123556 commit b0b44c2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mcp/client/streamable_http.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ async def handle_get_stream(
195195
self.url,
196196
headers=headers,
197197
timeout=httpx.Timeout(
198-
self.timeout.seconds, read=self.sse_read_timeout.seconds
198+
self.timeout.total_seconds(),
199+
read=self.sse_read_timeout.total_seconds(),
199200
),
200201
) as event_source:
201202
event_source.response.raise_for_status()
@@ -226,7 +227,7 @@ async def _handle_resumption_request(self, ctx: RequestContext) -> None:
226227
self.url,
227228
headers=headers,
228229
timeout=httpx.Timeout(
229-
self.timeout.seconds, read=ctx.sse_read_timeout.seconds
230+
self.timeout.total_seconds(), read=ctx.sse_read_timeout.total_seconds()
230231
),
231232
) as event_source:
232233
event_source.response.raise_for_status()
@@ -468,7 +469,8 @@ async def streamablehttp_client(
468469
async with httpx_client_factory(
469470
headers=transport.request_headers,
470471
timeout=httpx.Timeout(
471-
transport.timeout.seconds, read=transport.sse_read_timeout.seconds
472+
transport.timeout.total_seconds(),
473+
read=transport.sse_read_timeout.total_seconds(),
472474
),
473475
auth=transport.auth,
474476
) as client:

0 commit comments

Comments
 (0)