From: Brett Cannon Date: Tue, 13 May 2003 20:28:15 +0000 (+0000) Subject: Call time.tzset (if available) just before calculating possible timezones from time... X-Git-Tag: v2.3c1~727 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abe8eb0a3044fd1a23a2a46cc4bb61e4e022b7c0;p=thirdparty%2FPython%2Fcpython.git Call time.tzset (if available) just before calculating possible timezones from time.tzname. --- diff --git a/Lib/_strptime.py b/Lib/_strptime.py index a08a426916ae..f32acc0e03fc 100644 --- a/Lib/_strptime.py +++ b/Lib/_strptime.py @@ -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)