diff --git a/daemon.py b/daemon.py index 20dc14b8..7ef72831 100644 --- a/daemon.py +++ b/daemon.py @@ -1012,7 +1012,7 @@ class PubServer(BaseHTTPRequestHandler): print('Waiting for previous outbox thread to end') waitCtr = 0 thName = accountOutboxThreadName - while self.server.outboxThread[thName].isAlive() and waitCtr < 8: + while self.server.outboxThread[thName].is_alive() and waitCtr < 8: time.sleep(1) waitCtr += 1 if waitCtr >= 8: @@ -12087,7 +12087,7 @@ class PubServer(BaseHTTPRequestHandler): if self.server.newPostThread.get(newPostThreadName): print('Waiting for previous new post thread to end') waitCtr = 0 - while (self.server.newPostThread[newPostThreadName].isAlive() and + while (self.server.newPostThread[newPostThreadName].is_alive() and waitCtr < 8): time.sleep(1) waitCtr += 1 @@ -13005,7 +13005,7 @@ def runPostsWatchdog(projectVersion: str, httpd) -> None: httpd.thrPostsQueue.start() while True: time.sleep(20) - if not httpd.thrPostsQueue.isAlive(): + if not httpd.thrPostsQueue.is_alive(): httpd.thrPostsQueue.kill() httpd.thrPostsQueue = postsQueueOriginal.clone(runPostsQueue) httpd.thrPostsQueue.start() @@ -13020,7 +13020,7 @@ def runSharesExpireWatchdog(projectVersion: str, httpd) -> None: httpd.thrSharesExpire.start() while True: time.sleep(20) - if not httpd.thrSharesExpire.isAlive(): + if not httpd.thrSharesExpire.is_alive(): httpd.thrSharesExpire.kill() httpd.thrSharesExpire = sharesExpireOriginal.clone(runSharesExpire) httpd.thrSharesExpire.start() diff --git a/inbox.py b/inbox.py index 9a253683..192a34f3 100644 --- a/inbox.py +++ b/inbox.py @@ -2456,7 +2456,7 @@ def runInboxQueueWatchdog(projectVersion: str, httpd) -> None: httpd.thrInboxQueue.start() while True: time.sleep(20) - if not httpd.thrInboxQueue.isAlive() or httpd.restartInboxQueue: + if not httpd.thrInboxQueue.is_alive() or httpd.restartInboxQueue: httpd.restartInboxQueueInProgress = True httpd.thrInboxQueue.kill() httpd.thrInboxQueue = inboxQueueOriginal.clone(runInboxQueue) diff --git a/newsdaemon.py b/newsdaemon.py index 42a69994..c89ae24e 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -752,7 +752,7 @@ def runNewswireWatchdog(projectVersion: str, httpd) -> None: httpd.thrNewswireDaemon.start() while True: time.sleep(50) - if not httpd.thrNewswireDaemon.isAlive(): + if not httpd.thrNewswireDaemon.is_alive(): httpd.thrNewswireDaemon.kill() httpd.thrNewswireDaemon = \ newswireOriginal.clone(runNewswireDaemon) diff --git a/schedule.py b/schedule.py index c213c4ec..29808ca2 100644 --- a/schedule.py +++ b/schedule.py @@ -158,7 +158,7 @@ def runPostScheduleWatchdog(projectVersion: str, httpd) -> None: httpd.thrPostSchedule.start() while True: time.sleep(20) - if not httpd.thrPostSchedule.isAlive(): + if not httpd.thrPostSchedule.is_alive(): httpd.thrPostSchedule.kill() httpd.thrPostSchedule = \ postScheduleOriginal.clone(runPostSchedule) diff --git a/tests.py b/tests.py index 4b41b1fc..ca0d1bbc 100644 --- a/tests.py +++ b/tests.py @@ -236,11 +236,11 @@ def testThreads(): args=('test',), daemon=True) thr.start() - assert thr.isAlive() is True + assert thr.is_alive() is True time.sleep(1) thr.kill() thr.join() - assert thr.isAlive() is False + assert thr.is_alive() is False def createServerAlice(path: str, domain: str, port: int, @@ -462,7 +462,7 @@ def testPostMessageBetweenServers(): global thrAlice if thrAlice: - while thrAlice.isAlive(): + while thrAlice.is_alive(): thrAlice.stop() time.sleep(1) thrAlice.kill() @@ -476,7 +476,7 @@ def testPostMessageBetweenServers(): global thrBob if thrBob: - while thrBob.isAlive(): + while thrBob.is_alive(): thrBob.stop() time.sleep(1) thrBob.kill() @@ -490,8 +490,8 @@ def testPostMessageBetweenServers(): thrAlice.start() thrBob.start() - assert thrAlice.isAlive() is True - assert thrBob.isAlive() is True + assert thrAlice.is_alive() is True + assert thrBob.is_alive() is True # wait for both servers to be running while not (testServerAliceRunning and testServerBobRunning): @@ -690,11 +690,11 @@ def testPostMessageBetweenServers(): # stop the servers thrAlice.kill() thrAlice.join() - assert thrAlice.isAlive() is False + assert thrAlice.is_alive() is False thrBob.kill() thrBob.join() - assert thrBob.isAlive() is False + assert thrBob.is_alive() is False os.chdir(baseDir) shutil.rmtree(aliceDir) @@ -733,7 +733,7 @@ def testFollowBetweenServers(): global thrAlice if thrAlice: - while thrAlice.isAlive(): + while thrAlice.is_alive(): thrAlice.stop() time.sleep(1) thrAlice.kill() @@ -747,7 +747,7 @@ def testFollowBetweenServers(): global thrBob if thrBob: - while thrBob.isAlive(): + while thrBob.is_alive(): thrBob.stop() time.sleep(1) thrBob.kill() @@ -761,8 +761,8 @@ def testFollowBetweenServers(): thrAlice.start() thrBob.start() - assert thrAlice.isAlive() is True - assert thrBob.isAlive() is True + assert thrAlice.is_alive() is True + assert thrBob.is_alive() is True # wait for all servers to be running ctr = 0 @@ -862,11 +862,11 @@ def testFollowBetweenServers(): # stop the servers thrAlice.kill() thrAlice.join() - assert thrAlice.isAlive() is False + assert thrAlice.is_alive() is False thrBob.kill() thrBob.join() - assert thrBob.isAlive() is False + assert thrBob.is_alive() is False # queue item removed time.sleep(4) @@ -1290,7 +1290,7 @@ def testClientToServer(): global thrAlice if thrAlice: - while thrAlice.isAlive(): + while thrAlice.is_alive(): thrAlice.stop() time.sleep(1) thrAlice.kill() @@ -1304,7 +1304,7 @@ def testClientToServer(): global thrBob if thrBob: - while thrBob.isAlive(): + while thrBob.is_alive(): thrBob.stop() time.sleep(1) thrBob.kill() @@ -1318,8 +1318,8 @@ def testClientToServer(): thrAlice.start() thrBob.start() - assert thrAlice.isAlive() is True - assert thrBob.isAlive() is True + assert thrAlice.is_alive() is True + assert thrBob.is_alive() is True # wait for both servers to be running ctr = 0 @@ -1614,11 +1614,11 @@ def testClientToServer(): # stop the servers thrAlice.kill() thrAlice.join() - assert thrAlice.isAlive() is False + assert thrAlice.is_alive() is False thrBob.kill() thrBob.join() - assert thrBob.isAlive() is False + assert thrBob.is_alive() is False os.chdir(baseDir) # shutil.rmtree(aliceDir)