websockets
websockets copied to clipboard
docs: Correct the example for "Starting a server" in the API reference
It seems that server.close() is not an async function, so I changed
await server.close()
to
server.close()
await server.wait_closed()
in the API reference.
Thank for you the fix — indeed close() isn't a coroutine: https://github.com/python-websockets/websockets/blob/e217458ef8b692e45ca6f66c5aeb7fad0aee97ee/src/websockets/legacy/server.py#L724
I'm going to check how I introduced this mistake and merge the fix.
I found the same mistake in the FAQ and fixed it.