Fix host in address of socket.create_server example. (GH-17706)
Host as None in address raises TypeError since it should be string, bytes or bytearray.
This commit is contained in:
parent
ce54519aa0
commit
43682f1e39
|
@ -878,7 +878,7 @@ def create_server(address, *, family=AF_INET, backlog=None, reuse_port=False,
|
|||
connections. When false it will explicitly disable this option on
|
||||
platforms that enable it by default (e.g. Linux).
|
||||
|
||||
>>> with create_server((None, 8000)) as server:
|
||||
>>> with create_server(('', 8000)) as server:
|
||||
... while True:
|
||||
... conn, addr = server.accept()
|
||||
... # handle new connection
|
||||
|
|
Loading…
Reference in New Issue