diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/calendar.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/calendar.py')
-rw-r--r-- | contrib/tools/python3/src/Lib/calendar.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/tools/python3/src/Lib/calendar.py b/contrib/tools/python3/src/Lib/calendar.py index 7550d52c0a..586e489426 100644 --- a/contrib/tools/python3/src/Lib/calendar.py +++ b/contrib/tools/python3/src/Lib/calendar.py @@ -127,18 +127,18 @@ def monthrange(year, month): return day1, ndays -def _monthlen(year, month): +def _monthlen(year, month): return mdays[month] + (month == February and isleap(year)) -def _prevmonth(year, month): +def _prevmonth(year, month): if month == 1: return year-1, 12 else: return year, month-1 -def _nextmonth(year, month): +def _nextmonth(year, month): if month == 12: return year+1, 1 else: @@ -207,13 +207,13 @@ class Calendar(object): day1, ndays = monthrange(year, month) days_before = (day1 - self.firstweekday) % 7 days_after = (self.firstweekday - day1 - ndays) % 7 - y, m = _prevmonth(year, month) - end = _monthlen(y, m) + 1 + y, m = _prevmonth(year, month) + end = _monthlen(y, m) + 1 for d in range(end-days_before, end): yield y, m, d for d in range(1, ndays + 1): yield year, month, d - y, m = _nextmonth(year, month) + y, m = _nextmonth(year, month) for d in range(1, days_after + 1): yield y, m, d |