From 8c2429dbd3472d651a03839bd2568d30b1ed7c8d Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 15 Jan 2010 18:42:00 -0800 Subject: [PATCH] Catch IOError in addition to OSError in IOLoop.remove_handler (friendfeed's epoll module throws OSError, while the one in the standard library throws IOError) --- tornado/ioloop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 5c7f194f..0b00c334 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -102,7 +102,7 @@ class IOLoop(object): """Returns a global IOLoop instance. Most single-threaded applications have a single, global IOLoop. - Use this method instead of passing around IOLoop instances + Use this method instead of passing around IOLoop instances throughout your code. A common pattern for classes that depend on IOLoops is to use @@ -136,7 +136,7 @@ class IOLoop(object): self._events.pop(fd, None) try: self._impl.unregister(fd) - except OSError: + except (OSError, IOError): logging.debug("Error deleting fd from IOLoop", exc_info=True) def start(self):