Skip to content

Commit 4ff670c

Browse files
committed
Update EvalJob to fetch default Python version instead of hardcoding
1 parent e81b0f1 commit 4ff670c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bot/exts/utils/snekbox/_eval.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
import contextlib
44
from dataclasses import dataclass, field
55
from signal import Signals
6-
from typing import TYPE_CHECKING
6+
from typing import get_args
77

88
from discord.utils import escape_markdown, escape_mentions
99

1010
from bot.constants import Emojis
11+
from bot.exts.utils.snekbox._constants import SupportedPythonVersions
1112
from bot.exts.utils.snekbox._io import FILE_COUNT_LIMIT, FILE_SIZE_LIMIT, FileAttachment, sizeof_fmt
1213
from bot.log import get_logger
1314

14-
if TYPE_CHECKING:
15-
from bot.exts.utils.snekbox._cog import SupportedPythonVersions
16-
1715
log = get_logger(__name__)
1816

1917
SIGKILL = 9
@@ -26,7 +24,7 @@ class EvalJob:
2624
args: list[str]
2725
files: list[FileAttachment] = field(default_factory=list)
2826
name: str = "eval"
29-
version: SupportedPythonVersions = "3.13"
27+
version: SupportedPythonVersions = get_args(SupportedPythonVersions)[0]
3028

3129
@classmethod
3230
def from_code(cls, code: str, path: str = "main.py") -> EvalJob:

0 commit comments

Comments
 (0)