def convert_body_to_unicode(resp):
    """
    If the request body is bytes, decode it to a string (for python3 support)
    """
    try:
        if not isinstance(resp['body']['string'], six.text_type):
            resp['body']['string'] = resp['body']['string'].decode('utf-8')
    except (__HOLE__, TypeError, UnicodeDecodeError):
        # The thing we were converting either wasn't a dictionary or didn't
        # have the keys we were expecting.  Some of the tests just serialize
        # and deserialize a string.

        # Also, sometimes the thing actually is binary, so if you can't decode
        # it, just give up.
        pass
    return resp
dataset/ETHPy150Open kevin1024/vcrpy/vcr/serializers/compat.py/convert_body_to_unicode