]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix host in address of socket.create_server example. (GH-17706)
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>
Sat, 11 Jan 2020 05:16:30 +0000 (10:46 +0530)
committerGitHub <noreply@github.com>
Sat, 11 Jan 2020 05:16:30 +0000 (10:46 +0530)
Host as None in address raises TypeError since it should be string, bytes or bytearray.

Lib/socket.py

index 374f1124bf7e8388859f79098333a03581b20c54..cafa573a30c0525522cf0377c35cbd83cba0fed1 100755 (executable)
@@ -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