From abe8eb0a3044fd1a23a2a46cc4bb61e4e022b7c0 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 13 May 2003 20:28:15 +0000 Subject: [PATCH] Call time.tzset (if available) just before calculating possible timezones from time.tzname. --- Lib/_strptime.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/_strptime.py b/Lib/_strptime.py index a08a426916..f32acc0e03 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) -- 2.50.1