From 293d15d55993282863904af5621b83ed7532a43d Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 30 Jul 2010 16:47:13 -0700 Subject: [PATCH] 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). --- tornado/httpclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.47.2