Skip to content

Commit d9b5502

Browse files
g97iulio1609Copilot
andcommitted
fix: rename _cancelled to _ to satisfy pyright reportUnusedVariable
The split() return value for the cancelled subgroup is intentionally discarded. Use bare _ instead of _cancelled so pyright strict mode recognises it as an unused-by-design binding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ed76490 commit d9b5502

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mcp/shared/_exception_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def collapse_exception_group(
4646
# split(type) uses isinstance on leaf exceptions, NOT on the group.
4747
# Using split(lambda) is incorrect because the lambda would first be
4848
# called on the group object itself.
49-
_cancelled, non_cancelled = eg.split(cancelled_type)
49+
_, non_cancelled = eg.split(cancelled_type)
5050

5151
if non_cancelled is None:
5252
# Every exception is a cancellation – surface just one.

0 commit comments

Comments
 (0)