Changeset 388 for python/vendor/current/Lib/calendar.py
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Lib/calendar.py
r2 r388 96 96 97 97 def isleap(year): 98 """Return 1 for leap years, 0for non-leap years."""98 """Return True for leap years, False for non-leap years.""" 99 99 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) 100 100 … … 162 162 while True: 163 163 yield date 164 date += oneday 164 try: 165 date += oneday 166 except OverflowError: 167 # Adding one day could fail after datetime.MAXYEAR 168 break 165 169 if date.month != month and date.weekday() == self.firstweekday: 166 170 break … … 217 221 """ 218 222 Return the data for the specified year ready for formatting. The return 219 value is a list of month rows. Each month row contains up to width months.223 value is a list of month rows. Each month row contains up to width months. 220 224 Each month contains between 4 and 6 weeks and each week contains 1-7 221 225 days. Days are datetime.date objects. … … 487 491 488 492 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) 490 495 return _locale.getlocale(_locale.LC_TIME)[1] 491 496 … … 565 570 566 571 def setfirstweekday(firstweekday): 572 try: 573 firstweekday.__index__ 574 except AttributeError: 575 raise IllegalWeekdayError(firstweekday) 567 576 if not MONDAY <= firstweekday <= SUNDAY: 568 577 raise IllegalWeekdayError(firstweekday)
Note:
See TracChangeset
for help on using the changeset viewer.