From b9e31303886acb3eeb36e13dc0b520f3460502a0 Mon Sep 17 00:00:00 2001 From: BrianWang1990 Date: Thu, 14 May 2026 11:22:00 +0800 Subject: [PATCH] chore: drop unnecessary | None on LLMError and Mail.send (#36147) Co-authored-by: Brian Wang <20699847+BrianWang1990@users.noreply.github.com> --- api/core/errors/error.py | 4 ++-- api/extensions/ext_mail.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/core/errors/error.py b/api/core/errors/error.py index 8c1ba98ae1..826a5ebae5 100644 --- a/api/core/errors/error.py +++ b/api/core/errors/error.py @@ -1,9 +1,9 @@ class LLMError(ValueError): """Base class for all LLM exceptions.""" - description: str | None = None + description: str = "" - def __init__(self, description: str | None = None): + def __init__(self, description: str = ""): self.description = description diff --git a/api/extensions/ext_mail.py b/api/extensions/ext_mail.py index 042bf8cc47..ed30e94678 100644 --- a/api/extensions/ext_mail.py +++ b/api/extensions/ext_mail.py @@ -67,7 +67,7 @@ class Mail: case _: raise ValueError(f"Unsupported mail type {mail_type}") - def send(self, to: str, subject: str, html: str, from_: str | None = None): + def send(self, to: str, subject: str, html: str, from_: str = ""): if not self._client: raise ValueError("Mail client is not initialized")