From: Kevin McCarthy Date: Sun, 4 May 2014 06:48:09 +0000 (-1000) Subject: remove some unused serialization code X-Git-Tag: v1.0.0~23 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=bc45a965b25b1824a285189de98abf8725c8942e;p=vcrpy.git remove some unused serialization code --- diff --git a/vcr/serializers/compat.py b/vcr/serializers/compat.py index 42cfa7c..2b9e46b 100644 --- a/vcr/serializers/compat.py +++ b/vcr/serializers/compat.py @@ -2,33 +2,15 @@ import six def convert_to_bytes(resp): - #resp = convert_headers_to_bytes(resp) resp = convert_body_to_bytes(resp) return resp def convert_to_unicode(resp): - #resp = convert_headers_to_unicode(resp) resp = convert_body_to_unicode(resp) return resp -def convert_headers_to_bytes(resp): - try: - resp['headers'] = dict([(k.encode('utf-8'), [v.encode('utf-8') for v in values]) for k, values in resp['headers'].items()]) - except (KeyError, TypeError): - pass - return resp - - -def convert_headers_to_unicode(resp): - try: - resp['headers'] = dict([(k.decode('utf-8'), [v.decode('utf-8') for v in values]) for k, values in resp['headers'].items()]) - except (KeyError, TypeError): - pass - return resp - - def convert_body_to_bytes(resp): """ If the request body is a string, encode it to bytes (for python3 support)