Do not hide SSLErrors behind Timeouts.
authorCory Benfield <lukasaoz@gmail.com>
Wed, 11 Jul 2012 16:31:59 +0000 (17:31 +0100)
committerCory Benfield <lukasaoz@gmail.com>
Wed, 11 Jul 2012 16:31:59 +0000 (17:31 +0100)
requests/models.py

index 694d62a1cbb589fcb790a86809b862c8f96cb2f5..acffc8082040b19500793b99a70c50250af498d3 100644 (file)
@@ -600,10 +600,10 @@ class Request(object):
                 raise ConnectionError(e)
 
             except (_SSLError, _HTTPError) as e:
-                if self.verify and isinstance(e, _SSLError):
+                if isinstance(e, _SSLError):
                     raise SSLError(e)
-
-                raise Timeout('Request timed out.')
+                else:
+                    raise Timeout('Request timed out.')
 
             # build_response can throw TooManyRedirects
             self._build_response(r)