From: Ben Darnell Date: Mon, 13 Sep 2010 18:18:46 +0000 (-0700) Subject: Fix calls to getattr (which, unlike dict.get, does not default to None). X-Git-Tag: v1.2.0~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e1dbe248cdc6012ffa8feae71726bfef5c2f091;p=thirdparty%2Ftornado.git Fix calls to getattr (which, unlike dict.get, does not default to None). Reported in issue #137. --- 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