Issue #7523: Add SOCK_CLOEXEC and SOCK_NONBLOCK to the socket module,

where supported by the system.  Patch by Nikita Vetoshkin.
This commit is contained in:
Antoine Pitrou 2010-10-14 15:05:38 +00:00
parent f4061dac60
commit b1c5496738
9 changed files with 137 additions and 12 deletions

View file

@ -692,7 +692,8 @@ class BaseTestAPI(unittest.TestCase):
s = asyncore.dispatcher()
s.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.assertEqual(s.socket.family, socket.AF_INET)
self.assertEqual(s.socket.type, socket.SOCK_STREAM)
SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0)
self.assertEqual(s.socket.type, socket.SOCK_STREAM | SOCK_NONBLOCK)
def test_bind(self):
s1 = asyncore.dispatcher()