summaryrefslogtreecommitdiff
path: root/Lib/_strptime.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/_strptime.py')
-rw-r--r--Lib/_strptime.py4
1 files changed, 4 insertions, 0 deletions
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)