From 64344f80fea2e762f478168e36978696e91675e4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 13 Sep 2017 15:21:25 +0200 Subject: [PATCH] bpo-31234: Fix dangling thread in test_ftplib Clear also self.server_thread attribute in TestTimeouts.tearDown(). --- Lib/test/test_ftplib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 372282b4faf062..5880a1e941d342 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -988,6 +988,8 @@ def setUp(self): def tearDown(self): ftplib.FTP.port = self.old_port self.server_thread.join() + # Explicitly clear the attribute to prevent dangling thread + self.server_thread = None def server(self): # This method sets the evt 3 times: