From: Victor Stinner Date: Wed, 13 Sep 2017 13:43:58 +0000 (-0700) Subject: bpo-31234: Fix dangling thread in test_ftplib (#3544) X-Git-Tag: v3.7.0a1~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b157ce1e58b03988ce4340a55d0b856125833cc5;p=thirdparty%2FPython%2Fcpython.git bpo-31234: Fix dangling thread in test_ftplib (#3544) Clear also self.server_thread attribute in TestTimeouts.tearDown(). --- diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 372282b4faf0..5880a1e941d3 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -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: