Skip to content

Commit 34521ab

Browse files
change the check on body
1 parent 16b6c26 commit 34521ab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vcr/serializers/compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def convert_body_to_unicode(resp):
6363
body = resp.get("body")
6464

6565
if body is not None:
66-
try:
66+
if isinstance(body, dict) and "string" in body:
6767
body["string"] = _convert_string_to_unicode(body["string"])
68-
except (KeyError, TypeError, AttributeError):
68+
else:
6969
# The thing we were converting either wasn't a dictionary or
7070
# didn't have the keys we were expecting.
7171
# For example request object has no 'string' key.

0 commit comments

Comments
 (0)