Raise an exception in AppEngineHttpConnection.getresponse if response is None.
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py
index 334177e..fbd2d76 100644
--- a/python2/httplib2/__init__.py
+++ b/python2/httplib2/__init__.py
@@ -994,6 +994,10 @@
def getresponse(self):
return self.response
+ if self.response:
+ return self.response
+ else:
+ raise httplib.HTTPException()
def set_debuglevel(self, level):
pass
@@ -1160,7 +1164,6 @@
conn.close()
conn.connect()
continue
- pass
try:
response = conn.getresponse()
except (socket.error, httplib.HTTPException):