summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagarnicle <matthew.rademaker@gmail.com>2023-05-25 17:14:41 +1000
committerChristian Geier <geier@lostpackets.de>2023-06-03 23:29:00 +0200
commit8432e65607ef18e8cb47f8e847fe3238c330ace5 (patch)
tree4ae143eedf67ee866ca40add3b2266cab674aca1
parent442a1afee0ecbce9b2d4a4ad4d655663bc067e11 (diff)
Raise error properly on failure to parse ics
If cal_from_ics in icalendar.py raises a ValueError that is not to do with timezone issue, it will raise it instead of ignoring it and then generating "UnboundLocalError: local variable 'cal' referenced before assignment"
-rw-r--r--khal/icalendar.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/khal/icalendar.py b/khal/icalendar.py
index 29fa60cb..5ae17874 100644
--- a/khal/icalendar.py
+++ b/khal/icalendar.py
@@ -547,4 +547,6 @@ def cal_from_ics(ics: str) -> icalendar.Calendar:
icalendar.vUTCOffset.ignore_exceptions = True
cal = icalendar.Calendar.from_ical(ics)
icalendar.vUTCOffset.ignore_exceptions = False
+ else:
+ raise
return cal