Changeset 391 for python/trunk/Lib/_strptime.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/_strptime.py
r2 r391 223 223 224 224 Want possible matching values to be from longest to shortest. This 225 prevents the possibility of a match occur ing for a value that also225 prevents the possibility of a match occurring for a value that also 226 226 a substring of a larger value that should have matched (e.g., 'abc' 227 227 matching when 'abcdef' should have been the match). … … 327 327 raise ValueError("unconverted data remains: %s" % 328 328 data_string[found.end():]) 329 year = 1900 329 330 year = None 330 331 month = day = 1 331 332 hour = minute = second = fraction = 0 … … 426 427 tz = value 427 428 break 429 leap_year_fix = False 430 if year is None and month == 2 and day == 29: 431 year = 1904 # 1904 is first leap year of 20th century 432 leap_year_fix = True 433 elif year is None: 434 year = 1900 428 435 # If we know the week of the year and what day of that week, we can figure 429 436 # out the Julian day of the year. … … 447 454 if weekday == -1: 448 455 weekday = datetime_date(year, month, day).weekday() 456 if leap_year_fix: 457 # the caller didn't supply a year but asked for Feb 29th. We couldn't 458 # use the default of 1900 for computations. We set it back to ensure 459 # that February 29th is smaller than March 1st. 460 year = 1900 461 449 462 return (time.struct_time((year, month, day, 450 463 hour, minute, second,
Note:
See TracChangeset
for help on using the changeset viewer.