1. Devlon
  2. CherryPy


Rene Peinthor  committed 2b6a0e8

Python3.3 doesn't use setdaemon for initializing the daemon var anymore
So BackgroundTask would always use the current threads daemon mode on py3.3

  • Participants
  • Parent commits daf9bb4
  • Branches cherrypy-3.2.x

Comments (0)

Files changed (1)

File cherrypy/process/plugins.py

View file
  • Ignore whitespace
     it won't delay stopping the whole process.
-    def __init__(self, interval, function, args=[], kwargs={}, bus=None):
+    def __init__(self, interval, function, args=[], kwargs={}, bus=None, *, daemon=True):
         self.interval = interval
         self.function = function
         self.kwargs = kwargs
         self.running = False
         self.bus = bus
+        if daemon is not None:
+            self.daemon = daemon
+        else:
+            self.daemon = current_thread().daemon
     def cancel(self):
         self.running = False
                 # Quit on first error to avoid massive logs.
-    def _set_daemon(self):
-        return True
 class Monitor(SimplePlugin):
     """WSPBus listener to periodically run a callback in its own thread."""