From d9347689c709bf43e9ac1ba5927d898461ef71e1 Mon Sep 17 00:00:00 2001 From: vladimir Date: Mon, 20 May 2024 14:10:42 +0300 Subject: [PATCH] Fix DeprecationWarning on method `Thread.setDaemon` --- chatexchange/browser.py | 4 ++-- chatexchange/client.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chatexchange/browser.py b/chatexchange/browser.py index 0d57c63..ac3f16c 100644 --- a/chatexchange/browser.py +++ b/chatexchange/browser.py @@ -743,7 +743,7 @@ def start(self): name="ChatExchange: RoomSocketWatcher for room #{}".format( self.room_id), target=self._runner) - self.thread.setDaemon(True) + self.thread.daemon = True self.thread.start() def _runner(self): @@ -778,7 +778,7 @@ def start(self): name="ChatExchange: RoomPollingWatcher for room #{}".format( self.room_id), target=self._runner) - self.thread.setDaemon(True) + self.thread.daemon = True self.thread.start() def close(self): diff --git a/chatexchange/client.py b/chatexchange/client.py index 3bd06af..a01fd82 100644 --- a/chatexchange/client.py +++ b/chatexchange/client.py @@ -98,7 +98,7 @@ def __init__( self._recently_gotten_objects = collections.deque(maxlen=self._max_recently_gotten_objects) self._requests_served = 0 self._thread = threading.Thread(target=self._worker, name="ChatExchange: message_sender for chat.{}".format(host)) - self._thread.setDaemon(True) + self._thread.daemon = True self.aggressive_sender = send_aggressively