added a little piece of code to stop Utils.get_url trying to json decode an empty string.
This commit is contained in:
parent
d8cce800d1
commit
810ba3f0bb
1 changed files with 1 additions and 1 deletions
2
Utils.py
2
Utils.py
|
@ -86,7 +86,7 @@ def get_url(url, **kwargs):
|
||||||
break
|
break
|
||||||
response_content = response_content.decode(encoding or "utf8")
|
response_content = response_content.decode(encoding or "utf8")
|
||||||
data = response_content
|
data = response_content
|
||||||
if kwargs.get("json"):
|
if kwargs.get("json") and data:
|
||||||
try:
|
try:
|
||||||
data = json.loads(response_content)
|
data = json.loads(response_content)
|
||||||
except json.decoder.JSONDecodeError:
|
except json.decoder.JSONDecodeError:
|
||||||
|
|
Loading…
Reference in a new issue