diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2017-09-13 10:58:25 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-13 10:58:25 (GMT) |
| commit | d403a29c0055de6b03ed5ae7a5c564e1c95a5950 (patch) | |
| tree | 5f2472b332617c94b439230f31d8101549eaa356 /Lib/test/test_ftplib.py | |
| parent | b8f4163da30e16c7cd58fe04f4b17e38d53cd57e (diff) | |
| download | cpython-d403a29c0055de6b03ed5ae7a5c564e1c95a5950.zip cpython-d403a29c0055de6b03ed5ae7a5c564e1c95a5950.tar.gz cpython-d403a29c0055de6b03ed5ae7a5c564e1c95a5950.tar.bz2 | |
bpo-31234: Fix dangling thread in test_ftp/poplib (#3540)
Explicitly clear the server attribute in test_ftplib and test_poplib
to prevent dangling thread.
Diffstat (limited to 'Lib/test/test_ftplib.py')
| -rw-r--r-- | Lib/test/test_ftplib.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 151e091..372282b 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -470,6 +470,8 @@ class TestFTPClass(TestCase): 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): @@ -800,6 +802,8 @@ class TestIPv6Environment(TestCase): 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): @@ -859,6 +863,8 @@ class TestTLS_FTPClass(TestCase): 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): |
