Skip to content

Commit 8fd0fd0

Browse files
committed
Accept bytes in server
1 parent 99e4f9a commit 8fd0fd0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

interpreter/core/async_core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,11 @@ async def receive_input():
279279

280280
print("Received:", data)
281281

282-
if data.get("type") == "websocket.receive" and "text" in data:
283-
data = json.loads(data["text"])
282+
if data.get("type") == "websocket.receive":
283+
if "text" in data:
284+
data = json.loads(data["text"])
285+
elif "bytes" in data:
286+
data = data["bytes"]
284287
await async_interpreter.input(data)
285288
elif data.get("type") == "websocket.disconnect":
286289
print("Disconnecting.")

0 commit comments

Comments
 (0)