Skip to content

Commit d33ef2f

Browse files
authored
Merge pull request #118 from da4089/bad-tzname
Fix non-unique TZID when using zoneinfo-derived tzinfo's.
2 parents 2b7f6d7 + 265020d commit d33ef2f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

vobject/icalendar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ def pickTzid(tzinfo, allowUTC=False):
335335
if tzinfo is None or (not allowUTC and tzinfo_eq(tzinfo, utc)):
336336
return None
337337

338+
# Try a zoneinfo (CPython 3.9+) first.
339+
if hasattr(tzinfo, 'key'):
340+
return toUnicode(tzinfo.key)
341+
338342
# Try pytz tzid key
339343
if hasattr(tzinfo, 'tzid'):
340344
return toUnicode(tzinfo.tzid)

0 commit comments

Comments
 (0)