Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Lib/calendar.py

    r2 r388  
    9696
    9797def isleap(year):
    98     """Return 1 for leap years, 0 for non-leap years."""
     98    """Return True for leap years, False for non-leap years."""
    9999    return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
    100100
     
    162162        while True:
    163163            yield date
    164             date += oneday
     164            try:
     165                date += oneday
     166            except OverflowError:
     167                # Adding one day could fail after datetime.MAXYEAR
     168                break
    165169            if date.month != month and date.weekday() == self.firstweekday:
    166170                break
     
    217221        """
    218222        Return the data for the specified year ready for formatting. The return
    219         value is a list of month rows. Each month row contains upto width months.
     223        value is a list of month rows. Each month row contains up to width months.
    220224        Each month contains between 4 and 6 weeks and each week contains 1-7
    221225        days. Days are datetime.date objects.
     
    487491
    488492    def __enter__(self):
    489         self.oldlocale = _locale.setlocale(_locale.LC_TIME, self.locale)
     493        self.oldlocale = _locale.getlocale(_locale.LC_TIME)
     494        _locale.setlocale(_locale.LC_TIME, self.locale)
    490495        return _locale.getlocale(_locale.LC_TIME)[1]
    491496
     
    565570
    566571def setfirstweekday(firstweekday):
     572    try:
     573        firstweekday.__index__
     574    except AttributeError:
     575        raise IllegalWeekdayError(firstweekday)
    567576    if not MONDAY <= firstweekday <= SUNDAY:
    568577        raise IllegalWeekdayError(firstweekday)
Note: See TracChangeset for help on using the changeset viewer.