From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sun, 25 Sep 2022 11:32:04 +0200
Subject: Python: Fix deprecation warnung about setDaemon()

The daemon calling method has changed in Python 3.10. Modify the script
px2_bulk_update.py so it is using the new method in Python 3.10 onwards.
---
 px2_bulk_update.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/px2_bulk_update.py b/px2_bulk_update.py
index 39e66b3..6007871 100755
--- a/px2_bulk_update.py
+++ b/px2_bulk_update.py
@@ -139,6 +139,15 @@ class BulkUpdater: # pylint: disable=too-many-instance-attributes
         self.arguments = arguments # the arguments from cli/gui
         self.stop_event = None # event which is stopping threads and act as join handler
 
+    def _mark_as_daemon(self, t):
+        """
+        The daemon attribute method has changed in Python 3.10.
+        """
+        if sys.version_info >= (3, 10):
+            t.daemon = True
+        else:
+            t.setDaemon(True)
+
     def start(self):
         if not self._prepare():
             logger.error("Preparation failed")
@@ -163,6 +172,7 @@ class BulkUpdater: # pylint: disable=too-many-instance-attributes
         logger.info("Reading IP list")
         for i in range(self.arguments.threads):
             t = threading.Thread(target=self._creation_worker, daemon=True)
+            self._mark_as_daemon(t)
             t.start()
             threads.append(t)
 
@@ -176,12 +186,14 @@ class BulkUpdater: # pylint: disable=too-many-instance-attributes
         logger.debug("create update threads")
         for i in range(self.arguments.threads):
             t = threading.Thread(target=self._update_worker, daemon=True)
+            self._mark_as_daemon(t)
             t.start()
             threads.append(t)
 
         #status worker
         logger.debug("create status threads")
         t = threading.Thread(target=self._status_worker, daemon=True)
+        self._mark_as_daemon(t)
         t.start()
         threads.append(t)
 
