diff options
Diffstat (limited to 'python3')
| -rw-r--r-- | python3/httplib2/__init__.py | 2 | ||||
| -rwxr-xr-x | python3/httplib2test.py | 22 |
2 files changed, 14 insertions, 10 deletions
diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py index 1599e68..ae786c1 100644 --- a/python3/httplib2/__init__.py +++ b/python3/httplib2/__init__.py @@ -1046,7 +1046,7 @@ a string that contains the response entity body. if len(domain_port) == 2 and domain_port[1] == '443' and scheme == 'http': scheme = 'https' authority = domain_port[0] - + conn_key = scheme+":"+authority if conn_key in self.connections: conn = self.connections[conn_key] diff --git a/python3/httplib2test.py b/python3/httplib2test.py index 61a297a..4ef3a78 100755 --- a/python3/httplib2test.py +++ b/python3/httplib2test.py @@ -456,18 +456,22 @@ class HttpTest(unittest.TestCase): http.add_certificate("akeyfile", "acertfile", "bitworking.org")
try:
- (response, content) = http.request("https://bitworking.org", "GET")
- except:
- pass
- self.assertEqual(http.connections["https:bitworking.org"].key_file, "akeyfile")
- self.assertEqual(http.connections["https:bitworking.org"].cert_file, "acertfile")
+ (response, content) = http.request("https://bitworking.org", "GET")
+ except AttributeError:
+ self.assertEqual(http.connections["https:bitworking.org"].key_file, "akeyfile")
+ self.assertEqual(http.connections["https:bitworking.org"].cert_file, "acertfile")
+ except IOError:
+ # Skip on 3.2
+ pass
try:
(response, content) = http.request("https://notthere.bitworking.org", "GET")
- except:
- pass
- self.assertEqual(http.connections["https:notthere.bitworking.org"].key_file, None)
- self.assertEqual(http.connections["https:notthere.bitworking.org"].cert_file, None)
+ except httplib2.ServerNotFoundError:
+ self.assertEqual(http.connections["https:notthere.bitworking.org"].key_file, None)
+ self.assertEqual(http.connections["https:notthere.bitworking.org"].cert_file, None)
+ except IOError:
+ # Skip on 3.2
+ pass
|
