mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +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
|
self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday
|
||||||
|
|
||||||
def getfirstweekday(self):
|
def getfirstweekday(self):
|
||||||
return self._firstweekday
|
return self._firstweekday % 7
|
||||||
|
|
||||||
def setfirstweekday(self, firstweekday):
|
def setfirstweekday(self, firstweekday):
|
||||||
if not MONDAY <= firstweekday <= SUNDAY:
|
|
||||||
raise IllegalWeekdayError(firstweekday)
|
|
||||||
self._firstweekday = firstweekday
|
self._firstweekday = firstweekday
|
||||||
firstweekday = property(getfirstweekday, setfirstweekday)
|
firstweekday = property(getfirstweekday, setfirstweekday)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue