Skip to content

Commit f3146c1

Browse files
committed
Use -m sphinx build if supported
1 parent 49457de commit f3146c1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sphinx_autobuild/build.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import subprocess
44
import sys
55

6+
import sphinx
7+
68
from sphinx_autobuild.utils import show_command, show_message
79

810

@@ -30,7 +32,10 @@ def __call__(self, *, rebuild: bool = True):
3032
)
3133
raise
3234

33-
sphinx_build_args = ["-m", "sphinx"] + self.sphinx_args
35+
if sphinx.version_info[:3] >= (7, 2, 3):
36+
sphinx_build_args = ["-m", "sphinx", "build"] + self.sphinx_args
37+
else:
38+
sphinx_build_args = ["-m", "sphinx"] + self.sphinx_args
3439
show_command(["python"] + sphinx_build_args)
3540
try:
3641
subprocess.run([sys.executable] + sphinx_build_args, check=True)

0 commit comments

Comments
 (0)