aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2025-10-09 14:46:08 +0100
committerGravatar Joe Banks <[email protected]>2025-10-09 14:49:07 +0100
commit4ff670c35c92cea667a2872e63828f90e837cd53 (patch)
treecc4c42ae84852b7326ede880b744b48fd89d0e25
parentMove snekbox operational and typing constants to a new file (diff)
Update EvalJob to fetch default Python version instead of hardcoding
-rw-r--r--bot/exts/utils/snekbox/_eval.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/bot/exts/utils/snekbox/_eval.py b/bot/exts/utils/snekbox/_eval.py
index 3d2dd3201..73f843bc0 100644
--- a/bot/exts/utils/snekbox/_eval.py
+++ b/bot/exts/utils/snekbox/_eval.py
@@ -3,17 +3,15 @@ from __future__ import annotations
import contextlib
from dataclasses import dataclass, field
from signal import Signals
-from typing import TYPE_CHECKING
+from typing import get_args
from discord.utils import escape_markdown, escape_mentions
from bot.constants import Emojis
+from bot.exts.utils.snekbox._constants import SupportedPythonVersions
from bot.exts.utils.snekbox._io import FILE_COUNT_LIMIT, FILE_SIZE_LIMIT, FileAttachment, sizeof_fmt
from bot.log import get_logger
-if TYPE_CHECKING:
- from bot.exts.utils.snekbox._cog import SupportedPythonVersions
-
log = get_logger(__name__)
SIGKILL = 9
@@ -26,7 +24,7 @@ class EvalJob:
args: list[str]
files: list[FileAttachment] = field(default_factory=list)
name: str = "eval"
- version: SupportedPythonVersions = "3.13"
+ version: SupportedPythonVersions = get_args(SupportedPythonVersions)[0]
@classmethod
def from_code(cls, code: str, path: str = "main.py") -> EvalJob: