From 9818142b1bd20243733a953fb8aa2c7be314c47c Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Mon, 18 Dec 2017 20:02:54 -0500 Subject: bpo-32331: Fix socket.type when SOCK_NONBLOCK is available (#4877) --- Lib/socket.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Lib/socket.py') diff --git a/Lib/socket.py b/Lib/socket.py index 1ada24d332..2d8aee3e90 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -203,11 +203,7 @@ class socket(_socket.socket): For IP sockets, the address info is a pair (hostaddr, port). """ fd, addr = self._accept() - # If our type has the SOCK_NONBLOCK flag, we shouldn't pass it onto the - # new socket. We do not currently allow passing SOCK_NONBLOCK to - # accept4, so the returned socket is always blocking. - type = self.type & ~globals().get("SOCK_NONBLOCK", 0) - sock = socket(self.family, type, self.proto, fileno=fd) + sock = socket(self.family, self.type, self.proto, fileno=fd) # Issue #7995: if no default timeout is set and the listening # socket had a (non-zero) timeout, force the new socket in blocking # mode to override platform-specific socket flags inheritance. -- cgit v1.2.1