mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Always return firstweekday % 7 instead of complaining
on setting.
This commit is contained in:
parent
aba10cf153
commit
72d84af401
1 changed files with 1 additions and 3 deletions
|
@ -131,11 +131,9 @@ class Calendar(object):
|
|||
self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday
|
||||
|
||||
def getfirstweekday(self):
|
||||
return self._firstweekday
|
||||
return self._firstweekday % 7
|
||||
|
||||
def setfirstweekday(self, firstweekday):
|
||||
if not MONDAY <= firstweekday <= SUNDAY:
|
||||
raise IllegalWeekdayError(firstweekday)
|
||||
self._firstweekday = firstweekday
|
||||
firstweekday = property(getfirstweekday, setfirstweekday)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue