From 10f29c903751f80c3f53be433dcbbba6f1382048 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Thu, 20 Oct 2016 07:44:29 +0000 Subject: Issue #28471: Avoid ResourceWarning by detaching test socket --- Lib/test/test_socket.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 0cf7bfe..a56d8a4 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -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) -- cgit v0.12