From 0ce96c608eaf5c6acdc22f8343c64804b2d9c7b9 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 28 Dec 2024 15:59:02 +0100 Subject: [PATCH] py39 compatibility --- ics-now.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ics-now.py b/ics-now.py index 7b56e5f..1578b79 100644 --- a/ics-now.py +++ b/ics-now.py @@ -13,6 +13,7 @@ import sys from argparse import ArgumentParser from pathlib import Path from subprocess import check_output +from typing import Optional import pytz from icalendar import Calendar, Event @@ -79,7 +80,7 @@ class IcsNow: return [] return Calendar.from_ical(result, multiple=True) - def pick_most_important(self, events: list[Event]) -> Event | None: + def pick_most_important(self, events: list[Event]) -> Optional[Event]: if not events: return None # FIXME: sort by priority @@ -115,7 +116,7 @@ class IcsNow: json.dump(ret, sys.stdout, indent=2) sys.stdout.write("\n") - def serialize(self, event: Event | None): + def serialize(self, event: Optional[Event]): if event is None: return None out = {