From fa3cd4289353ef89613f8c9cf655147f55f494a2 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sat, 11 Feb 2023 23:13:47 +0200 Subject: [PATCH] Fix deprecated call --- clearml_session/single_thread_proxy.py | 3 +-- clearml_session/tcp_proxy.py | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/clearml_session/single_thread_proxy.py b/clearml_session/single_thread_proxy.py index 0f5ea0d..bd9cfe3 100644 --- a/clearml_session/single_thread_proxy.py +++ b/clearml_session/single_thread_proxy.py @@ -46,8 +46,7 @@ class SingleThreadProxy(object): self.server.listen(100) self.tgthost, self.tgtport = tgthost, tgtport self.buffer_size, self.delay = buffer_size, delay - self._proxy_daemon_thread = threading.Thread(target=self.main_loop) - self._proxy_daemon_thread.setDaemon(True) + self._proxy_daemon_thread = threading.Thread(target=self.main_loop, daemon=True) self._proxy_daemon_thread.start() def main_loop(self): diff --git a/clearml_session/tcp_proxy.py b/clearml_session/tcp_proxy.py index 2f274a5..a7975a1 100644 --- a/clearml_session/tcp_proxy.py +++ b/clearml_session/tcp_proxy.py @@ -46,8 +46,7 @@ class TcpProxy(object): resource.setrlimit(resource.RLIMIT_NOFILE, (max(4096, soft), hard)) except Exception: pass - self._proxy_daemon_thread = threading.Thread(target=self.daemon) - self._proxy_daemon_thread.setDaemon(True) + self._proxy_daemon_thread = threading.Thread(target=self.daemon, daemon=True) self._proxy_daemon_thread.start() def get_thread(self): @@ -349,8 +348,8 @@ class TcpProxy(object): self.active_local_sockets[uuid] = {'local_socket': in_socket} # check if thread is waiting - proxy_thread = threading.Thread(target=self.start_proxy_thread, args=(in_socket, uuid, init_data)) - proxy_thread.setDaemon(True) + proxy_thread = threading.Thread( + target=self.start_proxy_thread, args=(in_socket, uuid, init_data), daemon=True) self.log("Starting proxy thread " + proxy_thread.name) proxy_thread.start() except Exception as ex: