diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-10-31 17:34:34 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-10-31 17:34:34 (GMT) |
commit | d6868b4ed45617675151d5abda7acf0080df8ca5 (patch) | |
tree | 2646b2f5af75a1daa07ee0962e52cbcc9b4416a8 | |
parent | d094efd8b753a0b9cedfe07af6b5185d59de2797 (diff) | |
download | cpython-d6868b4ed45617675151d5abda7acf0080df8ca5.zip cpython-d6868b4ed45617675151d5abda7acf0080df8ca5.tar.gz cpython-d6868b4ed45617675151d5abda7acf0080df8ca5.tar.bz2 |
fix leaking sockets
-rw-r--r-- | Lib/test/test_asyncore.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 5450468..57e759d 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -564,6 +564,7 @@ class BaseTestAPI(unittest.TestCase): asyncore.dispatcher.handle_accept(self) def handle_accepted(self, sock, addr): + sock.close() self.flag = True server = TestListener() @@ -721,6 +722,7 @@ class BaseTestAPI(unittest.TestCase): s = asyncore.dispatcher(socket.socket()) self.assertFalse(s.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)) + s.socket.close() s.create_socket(socket.AF_INET, socket.SOCK_STREAM) s.set_reuse_addr() self.assertTrue(s.socket.getsockopt(socket.SOL_SOCKET, |