]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #28471: Avoid ResourceWarning by detaching test socket
authorMartin Panter <vadmium+py@gmail.com>
Thu, 20 Oct 2016 07:44:29 +0000 (07:44 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Thu, 20 Oct 2016 07:44:29 +0000 (07:44 +0000)
Lib/test/test_socket.py

index 0cf7bfe29391acfbe0f51f8ef52d8d2be6b1c3ff..a56d8a4101aee336033c0181994c147345240e48 100644 (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)