diff --git a/tests/test_connection.py b/tests/test_connection.py index d16504f..4ea73a5 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -443,7 +443,7 @@ async def test_handshake_exception_before_accept() -> None: async def handler(request): raise ValueError() - with pytest.raises((BaseExceptionGroup, ValueError)) as exc: + with pytest.raises((BaseExceptionGroup, ValueError)) as exc: # pylint: disable=possibly-used-before-assignment async with trio.open_nursery() as nursery: server = await nursery.start(serve_websocket, handler, HOST, 0, None) diff --git a/trio_websocket/_impl.py b/trio_websocket/_impl.py index 698948a..a708b76 100644 --- a/trio_websocket/_impl.py +++ b/trio_websocket/_impl.py @@ -77,7 +77,7 @@ def __exit__(self, ty, value, tb): if _TRIO_MULTI_ERROR: # pragma: no cover filtered_exception = trio.MultiError.filter(_ignore_cancel, value) # pylint: disable=no-member - elif isinstance(value, BaseExceptionGroup): + elif isinstance(value, BaseExceptionGroup): # pylint: disable=possibly-used-before-assignment filtered_exception = value.subgroup(lambda exc: not isinstance(exc, trio.Cancelled)) else: filtered_exception = _ignore_cancel(value)