]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Only catch pycurl.error, not all Exceptions around a call to multi.socket_action.
authorBen Darnell <bdarnell@beaker.local>
Fri, 30 Jul 2010 23:47:13 +0000 (16:47 -0700)
committerBen Darnell <bdarnell@beaker.local>
Fri, 30 Jul 2010 23:47:13 +0000 (16:47 -0700)
This was hiding an AttributeError being thrown on older versions of pycurl
(which did not expose the socket_action method).

tornado/httpclient.py

index 522f8ce37255c51d83843d07d08b1b9ed29804c0..ea4b598c820b2754a6be31a8fd567974b6ac087c 100644 (file)
@@ -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