diff --git a/Lib/_strptime.py b/Lib/_strptime.py index a08a426916a..f32acc0e03f 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)