From a5bf841898ab3482fb0e8880730a069b7e2b1ca4 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 3 Jul 2018 08:31:21 +0200 Subject: [PATCH] [Code Cleanup] Fix a broad except call It is enough to catch `UnknownTimeZoneError` here. --- calsocial/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calsocial/forms.py b/calsocial/forms.py index 3b0e4b6..dad0bd9 100644 --- a/calsocial/forms.py +++ b/calsocial/forms.py @@ -59,7 +59,7 @@ class TimezoneField(SelectField): try: self.data = pytz.timezone(value) - except Exception as exc: + except pytz.exceptions.UnknownTimeZoneError: raise ValueError(f'Unknown time zone {value}') def iter_choices(self):