1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

Add force reset around calls to actual connection from stubs, to ensure

compatibility with version of httplib/urlib2 in python 2.7.9. Closes #130.
This commit is contained in:
Ivan Malison
2014-12-26 05:07:02 -05:00
parent 5301149bd8
commit e1f65bcbdc

View File

@@ -236,12 +236,16 @@ class VCRConnection(object):
self._vcr_request
)
)
self.real_connection.request(
method=self._vcr_request.method,
url=self._url(self._vcr_request.uri),
body=self._vcr_request.body,
headers=self._vcr_request.headers,
)
# This is imported here to avoid circular import.
# TODO(@IvanMalison): Refactor to allow normal import.
from vcr.patch import force_reset
with force_reset():
self.real_connection.request(
method=self._vcr_request.method,
url=self._url(self._vcr_request.uri),
body=self._vcr_request.body,
headers=self._vcr_request.headers,
)
# get the response
response = self.real_connection.getresponse()