From acd270c171b4843edae276ab7be484ad0c00b633 Mon Sep 17 00:00:00 2001 From: Violin Date: Sun, 26 Jul 2026 17:23:25 +0100 Subject: [PATCH] fix(guard): use TypeVar for Python 3.11 compatibility in schemas.py --- plugins/violin_guard/schemas.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/violin_guard/schemas.py b/plugins/violin_guard/schemas.py index 88e5a3e..75d8bae 100644 --- a/plugins/violin_guard/schemas.py +++ b/plugins/violin_guard/schemas.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Literal +from typing import Any, Literal, TypeVar from pydantic import BaseModel, ConfigDict, Field @@ -315,7 +315,10 @@ class StatusArgsModel(BaseModel): # --------------------------------------------------------------------------- -def validate_args[T: BaseModel](model_cls: type[T], raw_args: dict[str, Any] | None) -> T: +T = TypeVar("T", bound=BaseModel) + + +def validate_args(model_cls: type[T], raw_args: dict[str, Any] | None) -> T: """Validate raw payload dictionary using Pydantic model.""" return model_cls.model_validate(raw_args or {})