From: Ben Darnell Date: Fri, 30 Jul 2010 23:47:13 +0000 (-0700) Subject: Only catch pycurl.error, not all Exceptions around a call to multi.socket_action. X-Git-Tag: v1.1.0~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=293d15d55993282863904af5621b83ed7532a43d;p=thirdparty%2Ftornado.git Only catch pycurl.error, not all Exceptions around a call to multi.socket_action. This was hiding an AttributeError being thrown on older versions of pycurl (which did not expose the socket_action method). --- diff --git a/tornado/httpclient.py b/tornado/httpclient.py index 522f8ce37..ea4b598c8 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -198,7 +198,7 @@ class AsyncHTTPClient(object): while True: try: ret, num_handles = self._multi.socket_action(fd, action) - except Exception, e: + except pycurl.error, e: ret = e[0] if ret != pycurl.E_CALL_MULTI_PERFORM: break @@ -212,7 +212,7 @@ class AsyncHTTPClient(object): try: ret, num_handles = self._multi.socket_action( pycurl.SOCKET_TIMEOUT, 0) - except Exception, e: + except pycurl.error, e: ret = e[0] if ret != pycurl.E_CALL_MULTI_PERFORM: break