Skip to content

Commit

Permalink
Update for the latest version of mypy.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Nov 20, 2022
1 parent f199a31 commit 26e1946
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ exclude_lines =
if self.debug:
pragma: no cover
raise AssertionError
raise NotImplementedError
self.fail\(".*"\)
5 changes: 5 additions & 0 deletions src/websockets/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def decode(
PayloadTooBig: if decoding the payload exceeds ``max_size``.
"""
raise NotImplementedError

def encode(self, frame: frames.Frame) -> frames.Frame:
"""
Expand All @@ -50,6 +51,7 @@ def encode(self, frame: frames.Frame) -> frames.Frame:
Frame: Encoded frame.
"""
raise NotImplementedError


class ClientExtensionFactory:
Expand All @@ -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,
Expand All @@ -91,6 +94,7 @@ def process_response_params(
NegotiationError: if parameters aren't acceptable.
"""
raise NotImplementedError


class ServerExtensionFactory:
Expand Down Expand Up @@ -126,3 +130,4 @@ def process_request_params(
the client aren't acceptable.
"""
raise NotImplementedError
2 changes: 0 additions & 2 deletions src/websockets/legacy/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down

0 comments on commit 26e1946

Please sign in to comment.