8000 gh-112240: Add option to calendar module CLI to specify the weekday to start each week by planet36 · Pull Request #112241 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-112240: Add option to calendar module CLI to specify the weekday to start each week #112241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove validation of CLI option firstweekday
  • Loading branch information
planet36 committed Dec 6, 2023
commit 7a5e02e742d1ebade083d300fe0e552f3087d943
3 changes: 0 additions & 3 deletions Lib/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,9 +758,6 @@ def main(args=None):

locale = options.locale, options.encoding

if not MONDAY <= options.firstweekday <= SUNDAY:
raise IllegalWeekdayError(options.firstweekday)

if options.type == "html":
if options.month:
parser.error("incorrect number of arguments")
Expand Down
4 changes: 0 additions & 4 deletions Lib/test/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,12 +1001,8 @@ def test_illegal_arguments(self):
self.assertFailure('2004', 'spam')
self.assertFailure('2004', '1', 'spam')
self.assertFailure('2004', '1', '1')
self.assertFailure('2004', '0')
self.assertFailure('2004', '13')
self.assertFailure('2004', '1', '1', 'spam')
self.assertFailure('-t', 'html', '2004', '1')
self.assertFailure('--firstweekday', '-1')
self.assertFailure('--firstweekday', '7')

def test_output_current_year(self):
for run in self.runners:
Expand Down
0