Skip to content

Commit

Permalink
Fix invocation of python -m sphinx build
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Aug 22, 2023
1 parent 6183b6a commit 02cb02c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sphinx/cmd/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,14 @@ def main(argv: Sequence[str] = (), /) -> int:
if not argv:
argv = sys.argv[1:]

# Allow calling as 'python -m sphinx build …'
if argv[:1] == ['build']:
argv = argv[1:]

if argv[:1] == ['--bug-report']:
return _bug_report_info()
if argv[:1] == ['-M']:
return make_main(argv)
elif argv[:1] == ['build']:
return build_main(argv[1:])
else:
return build_main(argv)

Expand Down

0 comments on commit 02cb02c

Please sign in to comment.