From: Kevin McCarthy Date: Sun, 9 Mar 2014 07:27:09 +0000 (-1000) Subject: expose sock, pass correct args to connect in stubs. should fix httplib2 in python3 X-Git-Tag: v0.7.0~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=dedca0f6e70e86de8598d5dfa90260416e397ba2;p=vcrpy.git expose sock, pass correct args to connect in stubs. should fix httplib2 in python3 --- diff --git a/vcr/stubs/__init__.py b/vcr/stubs/__init__.py index 82588ae..d80070c 100644 --- a/vcr/stubs/__init__.py +++ b/vcr/stubs/__init__.py @@ -192,7 +192,7 @@ class VCRConnection: def set_debuglevel(self, *args, **kwargs): self.real_connection.set_debuglevel(*args, **kwargs) - def connect(self): + def connect(self, *args, **kwargs): """ httplib2 uses this. Connects to the server I'm assuming. @@ -212,7 +212,7 @@ class VCRConnection: # Cassette is write-protected, don't actually connect return - return self.real_connection.connect(self) + return self.real_connection.connect(*args, **kwargs) def __init__(self, *args, **kwargs): # need to temporarily reset here because the real connection @@ -222,6 +222,7 @@ class VCRConnection: reset() self.real_connection = self._baseclass(*args, **kwargs) install(self.cassette) + self.sock = self.real_connection.sock class VCRHTTPConnection(VCRConnection):