libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [3/9] libcloud git commit: Only catch socket.error exception.
Date Thu, 14 Jan 2016 20:15:30 GMT
Only catch socket.error exception.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/08b548e1
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/08b548e1
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/08b548e1

Branch: refs/heads/trunk
Commit: 08b548e1a78aa73df006685c245c941c59e29395
Parents: d01e141
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Thu Jan 14 19:00:59 2016 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Thu Jan 14 19:00:59 2016 +0100

----------------------------------------------------------------------
 libcloud/httplib_ssl.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/08b548e1/libcloud/httplib_ssl.py
----------------------------------------------------------------------
diff --git a/libcloud/httplib_ssl.py b/libcloud/httplib_ssl.py
index 61f1ac6..73d2dee 100644
--- a/libcloud/httplib_ssl.py
+++ b/libcloud/httplib_ssl.py
@@ -298,8 +298,7 @@ class LibcloudHTTPSConnection(httplib.HTTPSConnection, LibcloudBaseConnection):
                 cert_reqs=ssl.CERT_REQUIRED,
                 ca_certs=self.ca_cert,
                 ssl_version=libcloud.security.SSL_VERSION)
-        except Exception:
-            exc_cls = sys.exc_info()[0]
+        except socket.error:
             e = sys.exc_info()[1]
             exc_msg = str(e)
 
@@ -310,7 +309,7 @@ class LibcloudHTTPSConnection(httplib.HTTPSConnection, LibcloudBaseConnection):
                 msg = (UNSUPPORTED_TLS_VERSION_ERROR_MSG %
                        (exc_msg, ssl_version))
 
-                new_e = exc_cls(msg)
+                new_e = socket.error(msg)
                 new_e.original_exc = e
                 raise new_e
 


Mime
View raw message