diff options
author | shimizukawa <shimizukawa@gmail.com> | 2015-01-17 14:37:09 +0900 |
---|---|---|
committer | shimizukawa <shimizukawa@gmail.com> | 2015-01-17 14:37:09 +0900 |
commit | e722258079ad099b97578441ce1809b6089c9964 (patch) | |
tree | 3ed2141efd95b130eb01db77d3bf28009fd68d30 /sphinx/make_mode.py | |
parent | 991d2455e8e80b2d33dfa6899c3a7a858815b417 (diff) | |
download | sphinx-git-e722258079ad099b97578441ce1809b6089c9964.tar.gz |
Fix: on windows, make-mode didn't work on Win32 platform if sphinx was invoked as `python sphinx-build.py`.
Diffstat (limited to 'sphinx/make_mode.py')
-rw-r--r-- | sphinx/make_mode.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py index bc32c4a24..8e0d196f4 100644 --- a/sphinx/make_mode.py +++ b/sphinx/make_mode.py @@ -251,13 +251,18 @@ class Make(object): doctreedir = self.builddir_join('doctrees') orig_cmd = sys.argv[0] - if orig_cmd.endswith('.exe'): + if sys.platform == 'win32' and orig_cmd.endswith('.exe'): + # win32: 'sphinx-build.exe' cmd = [orig_cmd] - elif sys.platform == 'win32': + elif sys.platform == 'win32' and os.path.splitext(orig_cmd)[1] == '': + # win32: 'sphinx-build' without extension cmd = [orig_cmd + '.exe'] - else: # ex. 'sphinx-build' or 'sphinx-build.py' + else: + # win32: 'sphinx-build.py' + # linux, mac: 'sphinx-build' or 'sphinx-build.py' cmd = [sys.executable, orig_cmd] + print(cmd) return call(cmd + ['-b', builder] + opts + ['-d', doctreedir, self.srcdir, self.builddir_join(builder)]) |