lightning: python3.5 compat
This commit is contained in:
parent
b95dc873ec
commit
81ab10d6e2
@ -726,7 +726,7 @@ async def readJson(reader):
|
|||||||
newlines = sum(1 if x == b"\n"[0] else 0 for x in data)
|
newlines = sum(1 if x == b"\n"[0] else 0 for x in data)
|
||||||
if newlines > 1: print("Too many newlines in Electrum/lightning.py!", data)
|
if newlines > 1: print("Too many newlines in Electrum/lightning.py!", data)
|
||||||
try:
|
try:
|
||||||
return json.loads(data)
|
return json.loads(data.decode("ascii")) # decoding for python3.5 compat
|
||||||
except ValueError:
|
except ValueError:
|
||||||
try:
|
try:
|
||||||
data += await asyncio.wait_for(reader.read(1), 1)
|
data += await asyncio.wait_for(reader.read(1), 1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user