Issue #28471: Avoid ResourceWarning by detaching test socket

This commit is contained in:
Martin Panter 2016-10-20 07:44:29 +00:00
parent 53478f8c6d
commit 10f29c9037

View file

@ -4559,6 +4559,7 @@ class TestExceptions(unittest.TestCase):
sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno())
sock0.close()
self.addCleanup(sock.detach)
with self.assertRaises(OSError):
sock.setblocking(False)