Skip to content

Commit 0d185f9

Browse files
committed
More wise JSON parsing with en empty body
1 parent 3df3f3b commit 0d185f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fdk/json/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def readline(stream):
4040
s = line.replace('\n"\n,', '",').replace("\n}", "}")
4141
print("Before JSON parsing: {}".format(s),
4242
file=sys.stderr, flush=True)
43-
return ujson.loads(s)
43+
return ujson.loads(s) if len(s) > 0 else {}
4444
if c == "\n":
4545
line += c
4646
ret = True

0 commit comments

Comments
 (0)