From: Szabó Antal Date: Sun, 12 Sep 2010 21:22:30 +0000 (+0200) Subject: Changed e[0] to e.args[0] X-Git-Tag: v1.2.0~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4118b8e7d3a56a3b6d5ba72d900349c58ac91595;p=thirdparty%2Ftornado.git Changed e[0] to e.args[0] --- diff --git a/tornado/httpclient.py b/tornado/httpclient.py index 3a3ae1c4f..26e447cc9 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -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() diff --git a/tornado/httpserver.py b/tornado/httpserver.py index b85704b44..199c39e99 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -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: diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 25bfec30c..173d2c09f 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -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: diff --git a/tornado/iostream.py b/tornado/iostream.py index 84feedd50..91ac29d7e 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -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",