Don't try to update from a response that has no content.
This commit is contained in:
Родитель
73c5b8f5a0
Коммит
06432e8e94
|
@ -262,12 +262,13 @@ class HttpObject(DataObject):
|
|||
"""
|
||||
self.raise_for_response(url, response, content)
|
||||
|
||||
try:
|
||||
data = json.loads(content)
|
||||
except UnicodeDecodeError:
|
||||
data = json.loads(content, cls=ForgivingDecoder)
|
||||
if self.response_has_content.get(response.status):
|
||||
try:
|
||||
data = json.loads(content)
|
||||
except UnicodeDecodeError:
|
||||
data = json.loads(content, cls=ForgivingDecoder)
|
||||
|
||||
self.update_from_dict(data)
|
||||
self.update_from_dict(data)
|
||||
|
||||
location_header = self.location_headers.get(response.status)
|
||||
if location_header is None:
|
||||
|
|
Загрузка…
Ссылка в новой задаче