Skip to content

Commit

Permalink
Use -m sphinx build if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Oct 2, 2024
1 parent 49457de commit f3146c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sphinx_autobuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import subprocess
import sys

import sphinx

from sphinx_autobuild.utils import show_command, show_message


Expand Down Expand Up @@ -30,7 +32,10 @@ def __call__(self, *, rebuild: bool = True):
)
raise

sphinx_build_args = ["-m", "sphinx"] + self.sphinx_args
if sphinx.version_info[:3] >= (7, 2, 3):
sphinx_build_args = ["-m", "sphinx", "build"] + self.sphinx_args
else:
sphinx_build_args = ["-m", "sphinx"] + self.sphinx_args
show_command(["python"] + sphinx_build_args)
try:
subprocess.run([sys.executable] + sphinx_build_args, check=True)
Expand Down

0 comments on commit f3146c1

Please sign in to comment.