]> granicus.if.org Git - python/commitdiff
Call time.tzset (if available) just before calculating possible timezones from time...
authorBrett Cannon <bcannon@gmail.com>
Tue, 13 May 2003 20:28:15 +0000 (20:28 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 13 May 2003 20:28:15 +0000 (20:28 +0000)
Lib/_strptime.py

index a08a426916aecc82acc7d3a651525ac464fc782f..f32acc0e03fc06c3c017e860d8503e953a793dc7 100644 (file)
@@ -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)