summaryrefslogtreecommitdiff
path: root/sphinx/make_mode.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-26 16:01:22 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-02-26 16:01:22 +0900
commit496ff70f4aeb1a60dc0f283d9a3d4d8451c4f7fe (patch)
tree6291cb017b64f4a3fc124557dccfa39063f1e5c3 /sphinx/make_mode.py
parent3a67910cf41d33e311c47a0b363494734acf5040 (diff)
parent5fc40108d94d7598c2ff09fb00ba781967ef70a4 (diff)
downloadsphinx-git-496ff70f4aeb1a60dc0f283d9a3d4d8451c4f7fe.tar.gz
Merge branch 'stable'
Diffstat (limited to 'sphinx/make_mode.py')
-rw-r--r--sphinx/make_mode.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py
index 346f9db2d..4f55d71aa 100644
--- a/sphinx/make_mode.py
+++ b/sphinx/make_mode.py
@@ -19,9 +19,9 @@ from __future__ import print_function
import os
import sys
from os import path
-from subprocess import call
import sphinx
+from sphinx import cmdline
from sphinx.util.console import bold, blue # type: ignore
from sphinx.util.osutil import cd, rmtree
@@ -277,20 +277,12 @@ class Make(object):
if doctreedir is None:
doctreedir = self.builddir_join('doctrees')
- orig_cmd = sys.argv[0]
- if sys.platform == 'win32' and orig_cmd.endswith('.exe'):
- # win32: 'sphinx-build.exe'
- cmd = [orig_cmd]
- elif sys.platform == 'win32' and os.path.splitext(orig_cmd)[1] == '':
- # win32: 'sphinx-build' without extension
- cmd = [orig_cmd + '.exe']
- else:
- # win32: 'sphinx-build.py'
- # linux, mac: 'sphinx-build' or 'sphinx-build.py'
- cmd = [sys.executable, orig_cmd]
-
- return call(cmd + ['-b', builder] + opts + # type: ignore
- ['-d', doctreedir, self.srcdir, self.builddir_join(builder)]) # type: ignore # NOQA
+ args = [sys.argv[0],
+ '-b', builder,
+ '-d', doctreedir,
+ self.srcdir,
+ self.builddir_join(builder)]
+ return cmdline.main(args + opts)
def run_make_mode(args):