summaryrefslogtreecommitdiff
path: root/Lib/_strptime.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2003-05-13 20:28:15 +0000
committerBrett Cannon <bcannon@gmail.com>2003-05-13 20:28:15 +0000
commitabe8eb0a3044fd1a23a2a46cc4bb61e4e022b7c0 (patch)
treed5f887810d9ef9014b43cbc8a41428c294a5b721 /Lib/_strptime.py
parentac6df95d07aa3951f8bfc6febce132e09850db73 (diff)
downloadcpython-git-abe8eb0a3044fd1a23a2a46cc4bb61e4e022b7c0.tar.gz
Call time.tzset (if available) just before calculating possible timezones from time.tzname.
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)