]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
need the sock for httplib2, don't want sock for requests, can't we all just get along?
authorKevin McCarthy <me@kevinmccarthy.org>
Sun, 9 Mar 2014 07:39:11 +0000 (21:39 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Sun, 9 Mar 2014 07:56:25 +0000 (21:56 -1000)
vcr/stubs/__init__.py
vcr/stubs/httplib2_stubs.py

index d80070c626f47175cb423b6f692cea0e91770e75..63d4610768c62bbf654b1dd5676dd190c161decd 100644 (file)
@@ -222,7 +222,6 @@ class VCRConnection:
         reset()
         self.real_connection = self._baseclass(*args, **kwargs)
         install(self.cassette)
-        self.sock = self.real_connection.sock
 
 
 class VCRHTTPConnection(VCRConnection):
index 4bfec2483d156e12aa6d441a85d2fe480e01254f..ad74400652f2c316b18e731028b96bce0553f920 100644 (file)
@@ -21,6 +21,7 @@ class VCRHTTPConnectionWithTimeout(VCRHTTPConnection,
 
         self.proxy_info = kwargs.pop('proxy_info', None)
         VCRHTTPConnection.__init__(self, *args, **safe_kwargs)
+        self.sock = self.real_connection.sock
 
 
 class VCRHTTPSConnectionWithTimeout(VCRHTTPSConnection,
@@ -49,3 +50,4 @@ class VCRHTTPSConnectionWithTimeout(VCRHTTPSConnection,
         self.disable_ssl_certificate_validation = kwargs.pop(
             'disable_ssl_certificate_validation', None)
         VCRHTTPSConnection.__init__(self, *args, **safe_kwargs)
+        self.sock = self.real_connection.sock