mirror of
https://github.com/RGBCube/VReplBot
synced 2025-05-31 13:18:12 +00:00
a
This commit is contained in:
parent
fff50afff9
commit
7c94d4c72b
1 changed files with 4 additions and 4 deletions
|
@ -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"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue