From 4ff670c35c92cea667a2872e63828f90e837cd53 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Thu, 9 Oct 2025 14:46:08 +0100 Subject: Update EvalJob to fetch default Python version instead of hardcoding --- bot/exts/utils/snekbox/_eval.py | 8 +++----- 1 file 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: -- cgit v1.2.3