Issue #13872: socket.detach() now marks the socket closed (as mirrored in the socket repr()).

Patch by Matt Joiner.
This commit is contained in:
Antoine Pitrou 2012-04-01 01:00:17 +02:00
parent 6211b88161
commit 70deb3de39
3 changed files with 15 additions and 0 deletions

View file

@ -951,6 +951,7 @@ class BasicTCPTest(SocketConnectedTest):
f = self.cli_conn.detach()
self.assertEqual(f, fileno)
# cli_conn cannot be used anymore...
self.assertTrue(self.cli_conn._closed)
self.assertRaises(socket.error, self.cli_conn.recv, 1024)
self.cli_conn.close()
# ...but we can create another socket using the (still open)