]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Changed e[0] to e.args[0]
authorSzabó Antal <szabot@szabot-desktop.(none)>
Sun, 12 Sep 2010 21:22:30 +0000 (23:22 +0200)
committerBen Darnell <ben@bendarnell.com>
Tue, 14 Sep 2010 20:04:42 +0000 (13:04 -0700)
tornado/httpclient.py
tornado/httpserver.py
tornado/ioloop.py
tornado/iostream.py

index 3a3ae1c4f43273542589c43a5136f3edbdfe1dc8..26e447cc90348a959425bf81ca3aa98e4e0eb0f7 100644 (file)
@@ -222,7 +222,7 @@ class AsyncHTTPClient(object):
             try:
                 ret, num_handles = self._socket_action(fd, action)
             except pycurl.error, e:
-                ret = e[0]
+                ret = e.args[0]
             if ret != pycurl.E_CALL_MULTI_PERFORM:
                 break
         self._finish_pending_requests()
@@ -236,7 +236,7 @@ class AsyncHTTPClient(object):
                     ret, num_handles = self._socket_action(
                         pycurl.SOCKET_TIMEOUT, 0)
                 except pycurl.error, e:
-                    ret = e[0]
+                    ret = e.args[0]
                 if ret != pycurl.E_CALL_MULTI_PERFORM:
                     break
             self._finish_pending_requests()
@@ -267,7 +267,7 @@ class AsyncHTTPClient(object):
                 try:
                     ret, num_handles = self._multi.socket_all()
                 except pycurl.error, e:
-                    ret = e[0]
+                    ret = e.args[0]
                 if ret != pycurl.E_CALL_MULTI_PERFORM:
                     break
             self._finish_pending_requests()
index b85704b44e3ffdadbf413606fc322493f80b4b6b..199c39e99a081390918b58a8886e7b42c66ceff9 100644 (file)
@@ -236,7 +236,7 @@ class HTTPServer(object):
             try:
                 connection, address = self._socket.accept()
             except socket.error, e:
-                if e[0] in (errno.EWOULDBLOCK, errno.EAGAIN):
+                if e.args[0] in (errno.EWOULDBLOCK, errno.EAGAIN):
                     return
                 raise
             if self.ssl_options is not None:
index 25bfec30cea07f40bd204b5b7d4627712f68a2d0..173d2c09ff114d7b27255955498c02bd6a45855b 100644 (file)
@@ -60,7 +60,7 @@ class IOLoop(object):
                 try:
                     connection, address = sock.accept()
                 except socket.error, e:
-                    if e[0] not in (errno.EWOULDBLOCK, errno.EAGAIN):
+                    if e.args[0] not in (errno.EWOULDBLOCK, errno.EAGAIN):
                         raise
                     return
                 connection.setblocking(0)
@@ -255,7 +255,7 @@ class IOLoop(object):
                 except (KeyboardInterrupt, SystemExit):
                     raise
                 except (OSError, IOError), e:
-                    if e[0] == errno.EPIPE:
+                    if e.args[0] == errno.EPIPE:
                         # Happens when the client closes the connection
                         pass
                     else:
index 84feedd500d0b1927a6cb3531910741f998d41dd..91ac29d7ed4604e6b236f4fa96a688c62746d924 100644 (file)
@@ -183,7 +183,7 @@ class IOStream(object):
         try:
             chunk = self.socket.recv(self.read_chunk_size)
         except socket.error, e:
-            if e[0] in (errno.EWOULDBLOCK, errno.EAGAIN):
+            if e.args[0] in (errno.EWOULDBLOCK, errno.EAGAIN):
                 return
             else:
                 logging.warning("Read error on %d: %s",
@@ -221,7 +221,7 @@ class IOStream(object):
                 num_bytes = self.socket.send(self._write_buffer)
                 self._write_buffer = self._write_buffer[num_bytes:]
             except socket.error, e:
-                if e[0] in (errno.EWOULDBLOCK, errno.EAGAIN):
+                if e.args[0] in (errno.EWOULDBLOCK, errno.EAGAIN):
                     break
                 else:
                     logging.warning("Write error on %d: %s",