From 28ddadc41d41fbcd41948a412377471b374b677b Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 28 Jul 2021 12:49:14 +0300 Subject: fix: use socket/bind/listen for compa with Python < 3.8 Sponsored-by: author --- share/python/lib/daemon.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/python/lib/daemon.md b/share/python/lib/daemon.md index 2a9a2e0..c4f5e27 100644 --- a/share/python/lib/daemon.md +++ b/share/python/lib/daemon.md @@ -51,7 +51,10 @@ import time time.sleep(2) -s = socket.create_server(("", 8888)) +s = socket.socket() +s.bind(("127.0.0.1", 8888)) +s.listen() + (conn, _) = s.accept() conn.recv(1) s.close() -- cgit v1.2.1