Skip to content

Commit 3817fe2

Browse files
committed
remove unnecessary shielded cancel scope
1 parent bd73448 commit 3817fe2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/mcp/shared/session.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,15 @@ async def send_request(
281281
response_or_error = await response_stream_reader.receive()
282282

283283
if scope.cancel_called:
284-
with anyio.CancelScope(shield=True):
285-
notification = CancelledNotification(
286-
method="notifications/cancelled",
287-
params=CancelledNotificationParams(
288-
requestId=request_id, reason="cancelled"
289-
),
290-
)
291-
await self._send_notification_internal(
292-
notification, request_id
293-
)
284+
notification = CancelledNotification(
285+
method="notifications/cancelled",
286+
params=CancelledNotificationParams(
287+
requestId=request_id, reason="cancelled"
288+
),
289+
)
290+
await self._send_notification_internal(
291+
notification, request_id
292+
)
294293

295294
raise McpError(
296295
ErrorData(

0 commit comments

Comments
 (0)