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:
Karthikeyan Singaravelan 2020-01-11 10:46:30 +05:30 committed by GitHub
parent ce54519aa0
commit 43682f1e39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 connections. When false it will explicitly disable this option on
platforms that enable it by default (e.g. Linux). platforms that enable it by default (e.g. Linux).
>>> with create_server((None, 8000)) as server: >>> with create_server(('', 8000)) as server:
... while True: ... while True:
... conn, addr = server.accept() ... conn, addr = server.accept()
... # handle new connection ... # handle new connection