commit | abe8eb0a3044fd1a23a2a46cc4bb61e4e022b7c0 | [log] [tgz] |
---|---|---|
author | Brett Cannon <bcannon@gmail.com> | Tue May 13 20:28:15 2003 +0000 |
committer | Brett Cannon <bcannon@gmail.com> | Tue May 13 20:28:15 2003 +0000 |
tree | d5f887810d9ef9014b43cbc8a41428c294a5b721 | |
parent | ac6df95d07aa3951f8bfc6febce132e09850db73 [diff] |
Call time.tzset (if available) just before calculating possible timezones from time.tzname.
diff --git a/Lib/_strptime.py b/Lib/_strptime.py index a08a426..f32acc0 100644 --- a/Lib/_strptime.py +++ b/Lib/_strptime.py
@@ -284,6 +284,10 @@ # 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)