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 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