We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 16b6c26 commit 34521abCopy full SHA for 34521ab
1 file changed
vcr/serializers/compat.py
@@ -63,9 +63,9 @@ def convert_body_to_unicode(resp):
63
body = resp.get("body")
64
65
if body is not None:
66
- try:
+ if isinstance(body, dict) and "string" in body:
67
body["string"] = _convert_string_to_unicode(body["string"])
68
- except (KeyError, TypeError, AttributeError):
+ else:
69
# The thing we were converting either wasn't a dictionary or
70
# didn't have the keys we were expecting.
71
# For example request object has no 'string' key.
0 commit comments