[Python-checkins] python/dist/src/Lib _strptime.py,1.19,1.20

bcannon@users.sourceforge.net bcannon@users.sourceforge.net
Thu, 03 Jul 2003 12:59:59 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv7713/Lib

Modified Files:
	_strptime.py 
Log Message:
Fixes bug of timezone value being left as -1 when ``time.tzname[0] ==
time.tzname[1] and not time.daylight`` is true when it should only when
time.daylight is true.  Tests are also fixed.

Closes bug #763047 and its cohort #763052.


Index: _strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** _strptime.py	29 Jun 2003 04:16:49 -0000	1.19
--- _strptime.py	3 Jul 2003 19:59:57 -0000	1.20
***************
*** 502,506 ****
              # it can be something other than -1.
              found_zone = found_dict['Z'].lower()
!             if locale_time.timezone[0] == locale_time.timezone[1]:
                  pass #Deals with bad locale setup where timezone info is
                       # the same; first found on FreeBSD 4.4.
--- 502,507 ----
              # it can be something other than -1.
              found_zone = found_dict['Z'].lower()
!             if locale_time.timezone[0] == locale_time.timezone[1] and \
!                time.daylight:
                  pass #Deals with bad locale setup where timezone info is
                       # the same; first found on FreeBSD 4.4.
***************
*** 509,515 ****
              elif locale_time.timezone[2].lower() == found_zone:
                  tz = 0
!             elif time.daylight:
!                 if locale_time.timezone[3].lower() == found_zone:
!                     tz = 1
  
      # Cannot pre-calculate datetime_date() since can change in Julian
--- 510,516 ----
              elif locale_time.timezone[2].lower() == found_zone:
                  tz = 0
!             elif time.daylight and \
!                 locale_time.timezone[3].lower() == found_zone:
!                 tz = 1
  
      # Cannot pre-calculate datetime_date() since can change in Julian