]> granicus.if.org Git - python/commitdiff
bpo-31234: Fix dangling thread in test_ftplib (#3544)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 13 Sep 2017 13:43:58 +0000 (06:43 -0700)
committerGitHub <noreply@github.com>
Wed, 13 Sep 2017 13:43:58 +0000 (06:43 -0700)
Clear also self.server_thread attribute in TestTimeouts.tearDown().

Lib/test/test_ftplib.py

index 372282b4faf062212c85697b97e04739630b801e..5880a1e941d342221443f63e1404849bccc98931 100644 (file)
@@ -988,6 +988,8 @@ class TestTimeouts(TestCase):
     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: