Skip to content

Commit 4cc411d

Browse files
committed
remove call to update_content_type, assert retvl is None
1 parent 95f1769 commit 4cc411d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

msrest/serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,10 +1495,10 @@ def failsafe_deserialize(self, target_obj, response_data, content_type=None):
14951495
14961496
:param str target_obj: The target object type to deserialize to.
14971497
:param str/dict data: The response data to deseralize.
1498+
:param str content_type: Swagger "produces" if available.
14981499
"""
14991500
try:
1500-
data = self._unpack_content(response_data, content_type)
1501-
return self(target_obj, data)
1501+
return self(target_obj, data, content_type=content_type)
15021502
except:
15031503
_LOGGER.warning(
15041504
"Ran into a deserialization error. Ignoring since this is failsafe deserialization"

tests/test_serialization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,8 @@ def __init__(self, **kwargs):
25432543
with pytest.raises(DeserializationError):
25442544
self.d(Error, json.dumps(''), 'text/html')
25452545

2546-
self.d.failsafe_deserialize(Error, json.dumps(''), 'text/html')
2546+
deserialized = self.d.failsafe_deserialize(Error, json.dumps(''), 'text/html')
2547+
assert deserialized is None
25472548

25482549
class TestModelInstanceEquality(unittest.TestCase):
25492550

0 commit comments

Comments
 (0)