applehelp: Sphinx crashes if `hiutil or codesign` commands not found

This commit is contained in:
Takeshi KOMIYA
2016-07-14 20:24:00 +09:00
parent 47b33e93e5
commit 2b6a83599d
2 changed files with 24 additions and 16 deletions

View File

@@ -4,6 +4,8 @@ Release 1.4.6 (in development)
Bugs fixed
----------
* applehelp: Sphinx crashes if ``hiutil`` or ``codesign`` commands not found
Release 1.4.5 (released Jul 13, 2016)
=====================================

View File

@@ -217,6 +217,7 @@ class AppleHelpBuilder(StandaloneHTMLBuilder):
self.warn('you will need to index this help book with:\n %s'
% (' '.join([pipes.quote(arg) for arg in args])))
else:
try:
p = subprocess.Popen(args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
@@ -227,6 +228,8 @@ class AppleHelpBuilder(StandaloneHTMLBuilder):
raise AppleHelpIndexerFailed(output)
else:
self.info('done')
except OSError:
raise AppleHelpIndexerFailed('Command not found: %s' % args[0])
# If we've been asked to, sign the bundle
if self.config.applehelp_codesign_identity:
@@ -248,6 +251,7 @@ class AppleHelpBuilder(StandaloneHTMLBuilder):
self.warn('you will need to sign this help book with:\n %s'
% (' '.join([pipes.quote(arg) for arg in args])))
else:
try:
p = subprocess.Popen(args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
@@ -258,3 +262,5 @@ class AppleHelpBuilder(StandaloneHTMLBuilder):
raise AppleHelpCodeSigningFailed(output)
else:
self.info('done')
except OSError:
raise AppleHelpCodeSigningFailed('Command not found: %s' % args[0])