[Code Cleanup] Fix a broad except call

It is enough to catch `UnknownTimeZoneError` here.
This commit is contained in:
Gergely Polonkai 2018-07-03 08:31:21 +02:00
parent 6e0d50552d
commit a5bf841898

View File

@ -59,7 +59,7 @@ class TimezoneField(SelectField):
try: try:
self.data = pytz.timezone(value) self.data = pytz.timezone(value)
except Exception as exc: except pytz.exceptions.UnknownTimeZoneError:
raise ValueError(f'Unknown time zone {value}') raise ValueError(f'Unknown time zone {value}')
def iter_choices(self): def iter_choices(self):