1. cherrypy
  2. CherryPy


Jason R. Coombs  committed 8a21a94 Merge

Merge fix from 3.2.x

  • Participants
  • Parent commits 55be1e7, 2df8c0c
  • Branches default

Comments (0)

Files changed (2)

File cherrypy/process/plugins.py

View file
  • Ignore whitespace
 class PerpetualTimer(Timer):
-    """A responsive subclass of threading._Timer whose run() method repeats.
+    """A responsive subclass of threading.Timer whose run() method repeats.
     Use this timer only when you really need a very interruptible timer;
     this checks its 'finished' condition up to 20 times a second, which can
     results in pretty high CPU usage
+    def __init__(self, *args, **kwargs):
+        "Override parent constructor to allow 'bus' to be provided."
+        self.bus = kwargs.pop('bus', None)
+        super(PerpetualTimer, self).__init__(*args, **kwargs)
     def run(self):
         while True:
                 self.function(*self.args, **self.kwargs)
             except Exception:
-                self.bus.log("Error in perpetual timer thread function %r." %
-                             self.function, level=40, traceback=True)
+                if self.bus:
+                    self.bus.log(
+                        "Error in perpetual timer thread function %r." %
+                        self.function, level=40, traceback=True)
                 # Quit on first error to avoid massive logs.

File release.py

View file
  • Ignore whitespace
 This script will walk a developer through the process of cutting a release.
-Based on 1
+Based on https://bitbucket.org/cherrypy/cherrypy/wiki/ReleaseProcess
 To cut a release, simply invoke this script at the changeset to be released.