diff options
| author | Joe Gregorio <jcgregorio@google.com> | 2011-06-06 16:39:56 -0400 |
|---|---|---|
| committer | Joe Gregorio <jcgregorio@google.com> | 2011-06-06 16:39:56 -0400 |
| commit | a2324f6072bf0a78e7c71d586c7689dee2ea70a8 (patch) | |
| tree | 29c5177ec60e82a20602cfd802f8d8f5b1c2fd49 /python3 | |
| parent | eb483aaa3d0c4c3b14b6117063efec4a51425168 (diff) | |
| download | httplib2-a2324f6072bf0a78e7c71d586c7689dee2ea70a8.tar.gz | |
Now testing against Python 3.2
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
|
