Fix utils.time.iana_timezone on python < 3.9

This commit is contained in:
Valentin Lorentz 2022-02-17 12:17:42 +01:00
parent 4e60d8812d
commit bc76f7ead4
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ def iana_timezone(name):
raise UnknownTimeZone(e.args[0]) from None
elif pytz:
try:
timezone = pytz.timezone(name)
return pytz.timezone(name)
except pytz.UnknownTimeZoneError as e:
raise UnknownTimeZone(e.args[0]) from None
else: