From 95f6468771e948f43a25dde3492f35d327ad51d7 Mon Sep 17 00:00:00 2001 From: Raul Go Date: Mon, 11 Nov 2024 11:30:07 +0100 Subject: [PATCH 1/2] fix union router.py --- src/mailrise/router.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mailrise/router.py b/src/mailrise/router.py index d77ec67..fdc916f 100644 --- a/src/mailrise/router.py +++ b/src/mailrise/router.py @@ -92,8 +92,8 @@ class AppriseNotification(typ.NamedTuple): notify_type: NotifyType = NotifyType.INFO body_format: NotifyFormat = NotifyFormat.TEXT attachments: typ.List[EmailAttachment] = [] - config_format: typ.Literal['text', 'yaml'] | None = None - asset: AppriseAsset | None = None + config_format: typ.Union[typ.Literal['text', 'yaml'], None] = None + asset: typ.Union[AppriseAsset, None] = None class Router(metaclass=ABCMeta): # pylint: disable=too-few-public-methods From b56bc2c7d3abf8a9830a8e4329f31672f74aa9ae Mon Sep 17 00:00:00 2001 From: Raul Go Date: Mon, 11 Nov 2024 11:31:39 +0100 Subject: [PATCH 2/2] fix union simple_router.py --- src/mailrise/simple_router.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mailrise/simple_router.py b/src/mailrise/simple_router.py index c13812b..980a696 100644 --- a/src/mailrise/simple_router.py +++ b/src/mailrise/simple_router.py @@ -141,7 +141,7 @@ async def email_to_apprise( attachments=email.attachments ) - def get_sender(self, key: _Key) -> _SimpleSender | None: + def get_sender(self, key: _Key) -> typ.Union[_SimpleSender, None]: """Find a sender by recipient key.""" return next( (sender for (pattern_key, sender) in self.senders