diff options
author | Yury Selivanov <yury@magic.io> | 2017-12-19 01:02:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 01:02:54 (GMT) |
commit | 9818142b1bd20243733a953fb8aa2c7be314c47c (patch) | |
tree | 625350fae6c199ae5442118eaf36db480fe00046 /Lib/socket.py | |
parent | 6efcb6d3d5911aaf699f9df3bb3bc26e94f38e6d (diff) | |
download | cpython-9818142b1bd20243733a953fb8aa2c7be314c47c.zip cpython-9818142b1bd20243733a953fb8aa2c7be314c47c.tar.gz cpython-9818142b1bd20243733a953fb8aa2c7be314c47c.tar.bz2 |
bpo-32331: Fix socket.type when SOCK_NONBLOCK is available (#4877)
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 1ada24d..2d8aee3 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. |