diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-03-18 01:21:01 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-03-18 01:21:01 +0900 |
commit | 9efaf18852fb076893e5a25aa624c0cba0316fa8 (patch) | |
tree | c03d23f3336fc1b5a7a64f86592882af4a40d193 /sphinx/make_mode.py | |
parent | d5e38b6e80ca3d3df86e3e16fbf455dcc9aa1fa1 (diff) | |
parent | d97f41c0e3051a2634b50f4e9abd5e490345cab0 (diff) | |
download | sphinx-git-9efaf18852fb076893e5a25aa624c0cba0316fa8.tar.gz |
Merge branch '1.7'
Diffstat (limited to 'sphinx/make_mode.py')
-rw-r--r-- | sphinx/make_mode.py | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py index b293ba54a..23fb4ce64 100644 --- a/sphinx/make_mode.py +++ b/sphinx/make_mode.py @@ -20,14 +20,14 @@ import os import subprocess import sys from os import path -from typing import TYPE_CHECKING import sphinx from sphinx.cmd.build import build_main from sphinx.util.console import color_terminal, nocolor, bold, blue # type: ignore from sphinx.util.osutil import cd, rmtree -if TYPE_CHECKING: +if False: + # For type annotation from typing import List # NOQA proj_name = os.getenv('SPHINXPROJ', '<project>') @@ -101,22 +101,34 @@ class Make(object): # type: () -> int if self.run_generic_build('latex') > 0: return 1 - with cd(self.builddir_join('latex')): - return subprocess.call([self.makecmd, 'all-pdf']) + try: + with cd(self.builddir_join('latex')): + return subprocess.call([self.makecmd, 'all-pdf']) + except OSError: + print('Error: Failed to run: %s' % self.makecmd) + return 1 def build_latexpdfja(self): # type: () -> int if self.run_generic_build('latex') > 0: return 1 - with cd(self.builddir_join('latex')): - return subprocess.call([self.makecmd, 'all-pdf-ja']) + try: + with cd(self.builddir_join('latex')): + return subprocess.call([self.makecmd, 'all-pdf-ja']) + except OSError: + print('Error: Failed to run: %s' % self.makecmd) + return 1 def build_info(self): # type: () -> int if self.run_generic_build('texinfo') > 0: return 1 - with cd(self.builddir_join('texinfo')): - return subprocess.call([self.makecmd, 'info']) + try: + with cd(self.builddir_join('texinfo')): + return subprocess.call([self.makecmd, 'info']) + except OSError: + print('Error: Failed to run: %s' % self.makecmd) + return 1 def build_gettext(self): # type: () -> int |