Skip to content

Commit e18b704

Browse files
authored
Merge pull request #92 from djangoliv/fix-204
fix: if status is 204, there is no response to parse
2 parents a1a5108 + 2f86e28 commit e18b704

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ovh/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ def call(self, method, path, data=None, need_auth=True):
423423

424424
# attempt to decode and return the response
425425
try:
426-
json_result = result.json()
426+
if status != 204:
427+
json_result = result.json()
428+
else:
429+
json_result = None
427430
except ValueError as error:
428431
raise InvalidResponse("Failed to decode API response", error)
429432

0 commit comments

Comments
 (0)