summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>2020-01-11 10:46:30 +0530
committerGitHub <noreply@github.com>2020-01-11 10:46:30 +0530
commit43682f1e39a3c61f0e8a638b887bcdcbfef766c5 (patch)
treeb9e2cdc68e96f61d45cad30d04e5d71df8557f05
parentce54519aa09772f4173b8c17410ed77e403f3ebf (diff)
downloadcpython-git-43682f1e39a3c61f0e8a638b887bcdcbfef766c5.tar.gz
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.
-rwxr-xr-xLib/socket.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 374f1124bf..cafa573a30 100755
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -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