Call time.tzset (if available) just before calculating possible timezones from time.tzname.

This commit is contained in:
Brett Cannon 2003-05-13 20:28:15 +00:00
parent ac6df95d07
commit abe8eb0a30
1 changed files with 4 additions and 0 deletions

View File

@ -284,6 +284,10 @@ class LocaleTime(object):
# Set self.__timezone by using time.tzname.
#
# Empty string used for matching when timezone is not used/needed.
try:
time.tzset()
except AttributeError:
pass
time_zones = ["UTC", "GMT"]
if time.daylight:
time_zones.extend(time.tzname)