1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00
This commit is contained in:
Kevin McCarthy
2014-04-23 21:24:12 -10:00
parent e002aab999
commit 582b8eab51
3 changed files with 4 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ from vcr.request import Request
from vcr.errors import CannotOverwriteExistingCassetteException from vcr.errors import CannotOverwriteExistingCassetteException
from . import compat from . import compat
class VCRFakeSocket(object): class VCRFakeSocket(object):
""" """
A socket that doesn't do anything! A socket that doesn't do anything!
@@ -35,7 +36,7 @@ class VCRFakeSocket(object):
this descriptor and make sure it's not closed. this descriptor and make sure it's not closed.
Return file descriptor 0 since that's stdin. Return file descriptor 0 since that's stdin.
""" """
return 0 # wonder how bad this is.... return 0 # wonder how bad this is....
def parse_headers_backwards_compat(header_dict): def parse_headers_backwards_compat(header_dict):

View File

@@ -31,7 +31,7 @@ def get_headers(response):
if six.PY3: if six.PY3:
header_list = response.msg._headers header_list = response.msg._headers
return [b': '.join((k.encode('utf-8'), v.encode('utf-8'))) + b'\r\n' return [b': '.join((k.encode('utf-8'), v.encode('utf-8'))) + b'\r\n'
for k, v in header_list] for k, v in header_list]
else: else:
return response.msg.headers return response.msg.headers

View File

@@ -47,7 +47,7 @@ class VCRHTTPSConnectionWithTimeout(VCRHTTPSConnection,
for kw in unknown_keys: for kw in unknown_keys:
del safe_kwargs[kw] del safe_kwargs[kw]
self.proxy_info = kwargs.pop('proxy_info', None) self.proxy_info = kwargs.pop('proxy_info', None)
if not 'ca_certs' in kwargs or kwargs['ca_certs'] is None: if 'ca_certs' not in kwargs or kwargs['ca_certs'] is None:
try: try:
import httplib2 import httplib2
self.ca_certs = httplib2.CA_CERTS self.ca_certs = httplib2.CA_CERTS