From: WEI Zhicheng Date: Wed, 6 Aug 2014 10:35:24 +0000 (+0800) Subject: Fix `PeriodicCallback' when callback function return `Future' and has X-Git-Tag: v4.0.1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a78184f90c21e3b2d288891e243c111f8091c3d4;p=thirdparty%2Ftornado.git Fix `PeriodicCallback' when callback function return `Future' and has `Exception' will silence ignore --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 738cc9644..e15252d34 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -969,10 +969,11 @@ class PeriodicCallback(object): if not self._running: return try: - self.callback() + return self.callback() except Exception: self.io_loop.handle_callback_exception(self.callback) - self._schedule_next() + finally: + self._schedule_next() def _schedule_next(self): if self._running: