Skip to content

Commit

Permalink
Fix depreciation warning: Thread.setDaemon(True) -> Thread.daemon = T…
Browse files Browse the repository at this point in the history
…rue.
  • Loading branch information
sobomax committed Mar 14, 2024
1 parent 117c984 commit 98a77f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vapp/AsteriskManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion vapp/PluginHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98a77f9

Please sign in to comment.