diff -r c45088b19342 Lib/test/test_socket.py --- a/Lib/test/test_socket.py Sun Sep 11 16:47:59 2016 +0300 +++ b/Lib/test/test_socket.py Sun Sep 11 23:46:51 2016 +0800 @@ -5347,6 +5347,7 @@ sock.bind((typ, name)) except FileNotFoundError as e: # type / algorithm is not available + sock.close() raise unittest.SkipTest(str(e), typ, name) return sock @@ -5508,6 +5509,7 @@ with self.assertRaises(TypeError): sock.sendmsg_afalg(op=socket.ALG_OP_ENCRYPT, assoclen=-1) + sock.close() def test_main(): tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,