Index: bundle/kronos.py ================================================================== --- bundle/kronos.py +++ bundle/kronos.py @@ -41,11 +41,11 @@ This is open-source software, released under the MIT Software License: http://www.opensource.org/licenses/mit-license.php """ -__version__="2.0" +__version__="2.1" __all__ = [ "DayTaskRescheduler", "ForkedIntervalTask", "ForkedMonthdayTask", @@ -273,14 +273,14 @@ # Low-level run method to do the actual scheduling loop. while self.running: try: self.sched.run() except Exception as x: - print >>sys.stderr, "ERROR DURING SCHEDULER EXECUTION",x - print >>sys.stderr, "".join( - traceback.format_exception(*sys.exc_info())) - print >>sys.stderr, "-" * 20 + print("ERROR DURING SCHEDULER EXECUTION",x, file=sys.stderr) + print("".join( + traceback.format_exception(*sys.exc_info())), file=sys.stderr) + print("-" * 20, file=sys.stderr) # queue is empty; sleep a short while before checking again if self.running: time.sleep(5) @@ -311,13 +311,13 @@ """Execute the actual task.""" self.action(*self.args, **self.kw) def handle_exception(self, exc): """Handle any exception that occured during task execution.""" - print >>sys.stderr, "ERROR DURING TASK EXECUTION", exc - print >>sys.stderr, "".join(traceback.format_exception(*sys.exc_info())) - print >>sys.stderr, "-" * 20 + print("ERROR DURING TASK EXECUTION", exc, file=sys.stderr) + print("".join(traceback.format_exception(*sys.exc_info())), file=sys.stderr) + print("-" * 20, file=sys.stderr) class SingleTask(Task): """A task that only runs once.""" @@ -559,20 +559,20 @@ if __name__=="__main__": def testaction(arg): - print ">>>TASK",arg,"sleeping 3 seconds" + print(">>>TASK",arg,"sleeping 3 seconds") time.sleep(3) - print "<<