From 159908e5726c3df5df58429d1ff3113137c57f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 8 Jun 2020 09:35:41 +0200 Subject: [PATCH] Replace long-deprecated Thread.isAlive() with .is_alive() Replace Thread.isAlive() calls with Thread.is_alive() to fix compatibility with Python 3.9. The new method was present since py2.6, the old one got deprecated in py3.1 and was finally removed in py3.9. --- test/threads_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/threads_test.py b/test/threads_test.py index 300f6a9c6..59ab5d488 100644 --- a/test/threads_test.py +++ b/test/threads_test.py @@ -41,7 +41,7 @@ def test_stop(self): self.assertGreater(len(wq.pool), 0) for t in wq.pool: - self.assertTrue(t.isAlive()) + self.assertTrue(t.is_alive()) for i in xrange_(200): wq.do(lambda x: x + 1, i) @@ -49,7 +49,7 @@ def test_stop(self): wq.stop() for t in wq.pool: - self.assertFalse(t.isAlive()) + self.assertFalse(t.is_alive()) self.assertIs(wq.queue.get(), STOP)