From 98a77f9cfc32a4fd0d64649f3b298482e8654843 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Wed, 13 Mar 2024 23:26:10 -0700 Subject: [PATCH] Fix depreciation warning: Thread.setDaemon(True) -> Thread.daemon = True. --- vapp/AsteriskManager.py | 2 +- vapp/PluginHandler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vapp/AsteriskManager.py b/vapp/AsteriskManager.py index bdcd995..0e902ac 100644 --- a/vapp/AsteriskManager.py +++ b/vapp/AsteriskManager.py @@ -192,6 +192,7 @@ class AsteriskManager(threading.Thread): The class running an Asterisk Manager protocol implementation. """ + daemon = True __authenticated = False __auth_sent = False __sock = None @@ -210,7 +211,6 @@ def __init__(self, host = "127.0.0.1", port = 5038, username = None, self.__cmd_queue = [] self.__cmd_lock = threading.Lock() threading.Thread.__init__(self) - self.setDaemon(True) self.__channels = {} self.__auth_cond = threading.Condition() self.__chan_lock = threading.Lock() diff --git a/vapp/PluginHandler.py b/vapp/PluginHandler.py index 28c71ee..9350a05 100644 --- a/vapp/PluginHandler.py +++ b/vapp/PluginHandler.py @@ -84,7 +84,7 @@ def loadPlugins(plugin_packages, exclude_modules = []): _daemons[full_name] = daemon _logger.debug("Daemon %s imported successfully." % modname) if (isinstance(daemon, Thread)): - daemon.setDaemon(True) + daemon.daemon = True daemon.start() except AttributeError: pass