Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion vobject/icalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def getTzid(tzid, smart=True):
tz = timezone(tzid)
registerTzid(toUnicode(tzid), tz)
except UnknownTimeZoneError as e:
logging.error(e)
logging.error("Unknown Timezone: %r", e.args[0])
except ImportError as e:
logging.error(e)
return tz
Expand Down Expand Up @@ -335,6 +335,10 @@ def pickTzid(tzinfo, allowUTC=False):
if tzinfo is None or (not allowUTC and tzinfo_eq(tzinfo, utc)):
return None

# Try a zoneinfo (CPython 3.9+) first.
if hasattr(tzinfo, 'key'):
return toUnicode(tzinfo.key)

# Try pytz tzid key
if hasattr(tzinfo, 'tzid'):
return toUnicode(tzinfo.tzid)
Expand Down
Loading