Only use Timeout if we don't have a final_resp

I'm sure the Timeout context manager is relatively cheap, but it can't
be free.

Change-Id: I71c0c5944ec372e9b983021dd024de0c5aa1ded2
This commit is contained in:
Tim Burke
2016-06-30 14:32:35 -07:00
committed by Alistair Coles
parent 9045f33869
commit d60662b2eb

View File

@@ -1471,10 +1471,10 @@ class Putter(object):
:returns: HTTPResponse :returns: HTTPResponse
:raises: Timeout if the response took too long :raises: Timeout if the response took too long
""" """
with Timeout(timeout):
# don't do this update of self.resp if the Expect response during # don't do this update of self.resp if the Expect response during
# conenct() was actually a final response # connect() was actually a final response
if not self.final_resp: if not self.final_resp:
with Timeout(timeout):
if informational: if informational:
self.resp = self.conn.getexpect() self.resp = self.conn.getexpect()
else: else: