summaryrefslogtreecommitdiffstats
path: root/Lib/_strptime.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2004-03-07 23:16:27 (GMT)
committerBrett Cannon <bcannon@gmail.com>2004-03-07 23:16:27 (GMT)
commit8172ac3d15a78d0a7a716465b5ce6d9f63434a08 (patch)
tree463646094332961937759950b857028cd281ade3 /Lib/_strptime.py
parentdd80f762650f42f5f9ae820d9f55b21ed6f33bc0 (diff)
downloadcpython-8172ac3d15a78d0a7a716465b5ce6d9f63434a08.zip
cpython-8172ac3d15a78d0a7a716465b5ce6d9f63434a08.tar.gz
cpython-8172ac3d15a78d0a7a716465b5ce6d9f63434a08.tar.bz2
Deal with possible case of having time.tzname[1] containing UTC or GMT.
Since it is known ahead of time that UTC and GMT always have no DST adjustment then just set the isdst value to 0 even if tzname[0] == tzname[1] . Fixes bug #897817 .
Diffstat (limited to 'Lib/_strptime.py')
-rw-r--r--Lib/_strptime.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index e93d146..361f52e 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -363,8 +363,8 @@ def strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
# Deal with bad locale setup where timezone names are the
# same and yet time.daylight is true; too ambiguous to
# be able to tell what timezone has daylight savings
- if time.tzname[0] == time.tzname[1] and \
- time.daylight:
+ if (time.tzname[0] == time.tzname[1] and
+ time.daylight and found_zone not in ("utc", "gmt")):
break
else:
tz = value