Close HTTPSConnection in case of exception
This commit is contained in:
parent
c929b5bd8f
commit
85efc31c10
|
@ -857,8 +857,10 @@ class _Request(object):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise MalformedResponseError(self.network, e)
|
raise MalformedResponseError(self.network, e)
|
||||||
|
|
||||||
self._check_response_for_errors(response_text)
|
try:
|
||||||
conn.close()
|
self._check_response_for_errors(response_text)
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
return response_text
|
return response_text
|
||||||
|
|
||||||
def execute(self, cacheable=False):
|
def execute(self, cacheable=False):
|
||||||
|
|
Loading…
Reference in a new issue