Skip to content

Commit b157ce1

Browse files
authored
bpo-31234: Fix dangling thread in test_ftplib (#3544)
Clear also self.server_thread attribute in TestTimeouts.tearDown().
1 parent d165e14 commit b157ce1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_ftplib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,8 @@ def setUp(self):
988988
def tearDown(self):
989989
ftplib.FTP.port = self.old_port
990990
self.server_thread.join()
991+
# Explicitly clear the attribute to prevent dangling thread
992+
self.server_thread = None
991993

992994
def server(self):
993995
# This method sets the evt 3 times:

0 commit comments

Comments
 (0)