From 6e1dbe248cdc6012ffa8feae71726bfef5c2f091 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Mon, 13 Sep 2010 11:18:46 -0700 Subject: [PATCH] Fix calls to getattr (which, unlike dict.get, does not default to None). Reported in issue #137. --- tornado/ioloop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tornado/ioloop.py b/tornado/ioloop.py index c88a1b010..25bfec30c 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -231,8 +231,8 @@ class IOLoop(object): # two ways EINTR might be signaled: # * e.errno == errno.EINTR # * e.args is like (errno.EINTR, 'Interrupted system call') - if (getattr(e, 'errno') == errno.EINTR or - (isinstance(getattr(e, 'args'), tuple) and + if (getattr(e, 'errno', None) == errno.EINTR or + (isinstance(getattr(e, 'args', None), tuple) and len(e.args) == 2 and e.args[0] == errno.EINTR)): logging.warning("Interrupted system call", exc_info=1) continue -- 2.47.2