mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
fix leaking sockets
This commit is contained in:
parent
d094efd8b7
commit
d6868b4ed4
1 changed files with 2 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue