From: Ben Darnell Date: Wed, 24 Feb 2010 23:18:39 +0000 (-0800) Subject: Always reraise KeyboardInterrupt and SystemExit whenever IOLoop tries to X-Git-Tag: v1.0.0~76^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=010271d7eca811f1540c8eda20d3d2d3c06feb10;p=thirdparty%2Ftornado.git Always reraise KeyboardInterrupt and SystemExit whenever IOLoop tries to swallow exceptions. --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 44cdffdea..8a325cb9c 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -195,7 +195,7 @@ class IOLoop(object): fd, events = self._events.popitem() try: self._handlers[fd](fd, events) - except KeyboardInterrupt: + except (KeyboardInterrupt, SystemExit): raise except (OSError, IOError), e: if e[0] == errno.EPIPE: @@ -308,6 +308,8 @@ class PeriodicCallback(object): if not self._running: return try: self.callback() + except (KeyboardInterrupt, SystemExit): + raise except: logging.error("Error in periodic callback", exc_info=True) self.start()