]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix calls to getattr (which, unlike dict.get, does not default to None).
authorBen Darnell <ben@bendarnell.com>
Mon, 13 Sep 2010 18:18:46 +0000 (11:18 -0700)
committerBen Darnell <ben@bendarnell.com>
Mon, 13 Sep 2010 18:18:46 +0000 (11:18 -0700)
Reported in issue #137.

tornado/ioloop.py

index c88a1b0107b5d399b991a80bdd8e0d3892b7984b..25bfec30cea07f40bd204b5b7d4627712f68a2d0 100644 (file)
@@ -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