]> granicus.if.org Git - python/commitdiff
Deal with possible case of having time.tzname[1] containing UTC or GMT.
authorBrett Cannon <bcannon@gmail.com>
Sun, 7 Mar 2004 23:16:27 +0000 (23:16 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 7 Mar 2004 23:16:27 +0000 (23:16 +0000)
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 .

Lib/_strptime.py

index e93d14682723c64282494b23920fe6d7554b188b..361f52e2dd96d8458e21d2592f88420f2f57ba30 100644 (file)
@@ -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