From 16f0bcc3ac471749ae9ad2f6f9b37d43c26471b1 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 31 Aug 2013 17:04:53 +0200 Subject: [PATCH] Don't run handler if it doesn't exist.. --- libs/tornado/ioloop.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/tornado/ioloop.py b/libs/tornado/ioloop.py index a36ab7a..91ee2c5 100755 --- a/libs/tornado/ioloop.py +++ b/libs/tornado/ioloop.py @@ -676,7 +676,8 @@ class PollIOLoop(IOLoop): while self._events: fd, events = self._events.popitem() try: - self._handlers[fd](fd, events) + if self._handlers.has_key(fd): + self._handlers[fd](fd, events) except (OSError, IOError) as e: if e.args[0] == errno.EPIPE: # Happens when the client closes the connection