From: Martin Panter Date: Thu, 20 Oct 2016 07:44:29 +0000 (+0000) Subject: Issue #28471: Avoid ResourceWarning by detaching test socket X-Git-Tag: v3.6.0b3~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10f29c903751f80c3f53be433dcbbba6f1382048;p=thirdparty%2FPython%2Fcpython.git Issue #28471: Avoid ResourceWarning by detaching test socket --- diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 0cf7bfe29391..a56d8a4101ae 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)