From 26e1946f4d02357c71ca909a8e347f38892900d1 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 20 Nov 2022 15:43:05 +0100 Subject: [PATCH] Update for the latest version of mypy. https://github.com/python/mypy/issues/2350 --- setup.cfg | 1 + src/websockets/extensions/base.py | 5 +++++ src/websockets/legacy/protocol.py | 2 -- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 47acf312c..48703df87 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,4 +35,5 @@ exclude_lines = if self.debug: pragma: no cover raise AssertionError + raise NotImplementedError self.fail\(".*"\) diff --git a/src/websockets/extensions/base.py b/src/websockets/extensions/base.py index 060967618..6c481a46c 100644 --- a/src/websockets/extensions/base.py +++ b/src/websockets/extensions/base.py @@ -38,6 +38,7 @@ def decode( PayloadTooBig: if decoding the payload exceeds ``max_size``. """ + raise NotImplementedError def encode(self, frame: frames.Frame) -> frames.Frame: """ @@ -50,6 +51,7 @@ def encode(self, frame: frames.Frame) -> frames.Frame: Frame: Encoded frame. """ + raise NotImplementedError class ClientExtensionFactory: @@ -69,6 +71,7 @@ def get_request_params(self) -> List[ExtensionParameter]: List[ExtensionParameter]: Parameters to send to the server. """ + raise NotImplementedError def process_response_params( self, @@ -91,6 +94,7 @@ def process_response_params( NegotiationError: if parameters aren't acceptable. """ + raise NotImplementedError class ServerExtensionFactory: @@ -126,3 +130,4 @@ def process_request_params( the client aren't acceptable. """ + raise NotImplementedError diff --git a/src/websockets/legacy/protocol.py b/src/websockets/legacy/protocol.py index 1b6e58efa..21784eb55 100644 --- a/src/websockets/legacy/protocol.py +++ b/src/websockets/legacy/protocol.py @@ -220,8 +220,6 @@ def __init__( # Logger or LoggerAdapter for this connection. if logger is None: logger = logging.getLogger("websockets.protocol") - # https://github.com/python/typeshed/issues/5561 - logger = cast(logging.Logger, logger) self.logger: LoggerLike = logging.LoggerAdapter(logger, {"websocket": self}) """Logger for this connection."""