1
Fork 0
mirror of https://github.com/RGBCube/VReplBot synced 2025-05-31 13:18:12 +00:00
This commit is contained in:
RGBCube 2023-02-03 23:17:26 +03:00
parent fff50afff9
commit 7c94d4c72b

View file

@ -1,6 +1,6 @@
from __future__ import annotations
import json
import ast
from io import BytesIO
from typing import Literal, TYPE_CHECKING
@ -50,8 +50,8 @@ class Playground(
f"https://play.vlang.io/run",
data = { "code": code },
) as response:
body = json.loads(await response.text())
print(body, type(body))
body = ast.literal_eval(await response.text())
return body["ok"], body["output"]
async def test_code(self, code: str) -> tuple[bool, str]:
@ -59,7 +59,7 @@ class Playground(
f"https://play.vlang.io/run_test",
data = { "code": code },
) as response:
body = json.loads(await response.text())
body = ast.literal_eval(await response.text())
return body["ok"], body["output"]