Skip to content

Commit

Permalink
Fix errors in the documentation of 23a2d3f.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Jan 18, 2023
1 parent 7162452 commit f2176eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/project/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ New features

* Made it possible to close a server without closing existing connections.

* Added :attr:`~protocol.ServerProtocol.select_subprotocol` to customize
* Added :attr:`~server.ServerProtocol.select_subprotocol` to customize
negotiation of subprotocols in the Sans-I/O layer.

10.4
Expand Down
13 changes: 6 additions & 7 deletions src/websockets/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ def __init__(
origins: Optional[Sequence[Optional[Origin]]] = None,
extensions: Optional[Sequence[ServerExtensionFactory]] = None,
subprotocols: Optional[Sequence[Subprotocol]] = None,
select_subprotocol: Optional[SelectSubprotocol] = None,
select_subprotocol: Optional[
Callable[
[ServerProtocol, Sequence[Subprotocol]],
Optional[Subprotocol],
]
] = None,
state: State = CONNECTING,
max_size: Optional[int] = 2**20,
logger: Optional[LoggerLike] = None,
Expand Down Expand Up @@ -562,12 +567,6 @@ def parse(self) -> Generator[None, None, None]:
yield from super().parse()


SelectSubprotocol = Callable[
[ServerProtocol, Sequence[Subprotocol]],
Optional[Subprotocol],
]


class ServerConnection(ServerProtocol):
def __init__(self, *args: Any, **kwargs: Any) -> None:
warnings.warn(
Expand Down

0 comments on commit f2176eb

Please sign in to comment.