From: Kevin McCarthy Date: Sun, 10 Nov 2013 03:40:36 +0000 (-1000) Subject: Remove Some stray \t characters X-Git-Tag: v0.4.0~5 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=6200493896f73414d80d25adbde1524597ae6b45;p=vcrpy.git Remove Some stray \t characters I guess that's what I get for playing around with my vimrc. Thanks to @bryanhelmig for pointing these out. --- diff --git a/vcr/stubs/__init__.py b/vcr/stubs/__init__.py index a97da73..5132358 100644 --- a/vcr/stubs/__init__.py +++ b/vcr/stubs/__init__.py @@ -16,7 +16,7 @@ class VCRHTTPResponse(object): self.status = recorded_response['status']['code'] self.version = None self._content = StringIO(self.recorded_response['body']['string']) - self.closed = False + self.closed = False # We are skipping the header parsing (they have already been parsed # at this point) and directly adding the headers to the header @@ -81,18 +81,18 @@ class VCRConnectionMixin: def close(self): self._restore_socket() - self._baseclass.close(self) + self._baseclass.close(self) def _restore_socket(self): """ - Since some libraries (REQUESTS!!) decide to set options on - connection.socket, I need to delete the socket attribute - (which makes requests think this is a AppEngine connection) - and then restore it when I want to make the actual request. - This function restores it to its standard initial value - (which is None) + Since some libraries (REQUESTS!!) decide to set options on + connection.socket, I need to delete the socket attribute + (which makes requests think this is a AppEngine connection) + and then restore it when I want to make the actual request. + This function restores it to its standard initial value + (which is None) """ - if not hasattr(self, 'sock'): + if not hasattr(self, 'sock'): self.sock = None def _send_request(self, method, url, body, headers): @@ -150,7 +150,7 @@ class VCRConnectionMixin: if isinstance(message_body, str): msg += message_body message_body = None - self._restore_socket() + self._restore_socket() self._baseclass.send(self, msg) if message_body is not None: #message_body was not a string (i.e. it is a file) and @@ -175,10 +175,10 @@ class VCRConnectionMixin: # Otherwise, we should send the request, then get the response # and return it. - # restore sock's value to None, since we need a real socket - self._restore_socket() + # restore sock's value to None, since we need a real socket + self._restore_socket() - #make the actual request + #make the actual request self._baseclass.request( self, method=self._vcr_request.method, @@ -211,8 +211,8 @@ class VCRHTTPConnection(VCRConnectionMixin, HTTPConnection): def __init__(self, *args, **kwargs): HTTPConnection.__init__(self, *args, **kwargs) - # see VCRConnectionMixin._restore_socket for the motivation here - del self.sock + # see VCRConnectionMixin._restore_socket for the motivation here + del self.sock class VCRHTTPSConnection(VCRConnectionMixin, HTTPSConnection): @@ -227,5 +227,5 @@ class VCRHTTPSConnection(VCRConnectionMixin, HTTPSConnection): HTTPConnection.__init__(self, *args, **kwargs) self.key_file = kwargs.pop('key_file', None) self.cert_file = kwargs.pop('cert_file', None) - # see VCRConnectionMixin._restore_socket for the motivation here - del self.sock + # see VCRConnectionMixin._restore_socket for the motivation here + del self.sock