mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3400: make-mode don't use subprocess on building docs
This commit is contained in:
parent
341986c03a
commit
e0fa1d05b0
1
CHANGES
1
CHANGES
@ -12,6 +12,7 @@ Features added
|
|||||||
|
|
||||||
* Support requests-2.0.0 (experimental) (refs: #3367)
|
* Support requests-2.0.0 (experimental) (refs: #3367)
|
||||||
* (latex) PDF page margin dimensions may be customized (refs: #3387)
|
* (latex) PDF page margin dimensions may be customized (refs: #3387)
|
||||||
|
* #3400: make-mode doesn't use subprocess on building docs
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
@ -19,9 +19,9 @@ from __future__ import print_function
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from os import path
|
from os import path
|
||||||
from subprocess import call
|
|
||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
|
from sphinx import cmdline
|
||||||
from sphinx.util.console import bold, blue
|
from sphinx.util.console import bold, blue
|
||||||
from sphinx.util.osutil import cd, rmtree
|
from sphinx.util.osutil import cd, rmtree
|
||||||
|
|
||||||
@ -250,20 +250,12 @@ class Make(object):
|
|||||||
if doctreedir is None:
|
if doctreedir is None:
|
||||||
doctreedir = self.builddir_join('doctrees')
|
doctreedir = self.builddir_join('doctrees')
|
||||||
|
|
||||||
orig_cmd = sys.argv[0]
|
args = [sys.argv[0],
|
||||||
if sys.platform == 'win32' and orig_cmd.endswith('.exe'):
|
'-b', builder,
|
||||||
# win32: 'sphinx-build.exe'
|
'-d', doctreedir,
|
||||||
cmd = [orig_cmd]
|
self.srcdir,
|
||||||
elif sys.platform == 'win32' and os.path.splitext(orig_cmd)[1] == '':
|
self.builddir_join(builder)]
|
||||||
# win32: 'sphinx-build' without extension
|
return cmdline.main(args + opts)
|
||||||
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 +
|
|
||||||
['-d', doctreedir, self.srcdir, self.builddir_join(builder)])
|
|
||||||
|
|
||||||
|
|
||||||
def run_make_mode(args):
|
def run_make_mode(args):
|
||||||
|
Loading…
Reference in New Issue
Block a user