From 21ebbb7d3918db6101c3c49ee04cac95d156003d Mon Sep 17 00:00:00 2001 From: Brian Curtin Date: Tue, 2 Nov 2010 02:07:09 +0000 Subject: [PATCH] Clean up ResourceWarnings due to unclosed sockets. --- Lib/test/test_socket.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index e20364dca9..704d46e672 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -259,6 +259,7 @@ class GeneralModuleTests(unittest.TestCase): def test_repr(self): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.addCleanup(s.close) self.assertTrue(repr(s).startswith("