Explicitly clear the server attribute in test_ftplib and test_poplib
to prevent dangling thread.
def tearDown(self):
self.client.close()
self.server.stop()
+ # Explicitly clear the attribute to prevent dangling thread
+ self.server = None
asyncore.close_all(ignore_all=True)
def check_data(self, received, expected):
def tearDown(self):
self.client.close()
self.server.stop()
+ # Explicitly clear the attribute to prevent dangling thread
+ self.server = None
asyncore.close_all(ignore_all=True)
def test_af(self):
def tearDown(self):
self.client.close()
self.server.stop()
+ # Explicitly clear the attribute to prevent dangling thread
+ self.server = None
asyncore.close_all(ignore_all=True)
def test_control_connection(self):
def tearDown(self):
self.client.close()
self.server.stop()
+ # Explicitly clear the attribute to prevent dangling thread
+ self.server = None
def test_getwelcome(self):
self.assertEqual(self.client.getwelcome(),
# this exception
self.client.close()
self.server.stop()
+ # Explicitly clear the attribute to prevent dangling thread
+ self.server = None
def test_stls(self):
self.assertRaises(poplib.error_proto, self.client.stls)
def tearDown(self):
self.thread.join()
- del self.thread # Clear out any dangling Thread objects.
+ # Explicitly clear the attribute to prevent dangling thread
+ self.thread = None
def server(self, evt, serv):
serv.listen()