Comment 4 for bug 244681

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Loading all the timezone objects is definitely the most thorough check, but it takes at least 300 milliseconds. Checking that the timezone files exist with os.path.isfile only takes 4 milliseconds.

>>> for timezone_name in pytz.common_timezones:
... if not os.path.isfile(os.path.join(dir, timezone_name)):
... pytz.common_timezones.remove(timezone_name)