From 990e73c3837c032235f4e3cb9075e766c639191d Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 13 Sep 2014 16:05:40 -0400 Subject: [PATCH] Catch Spinx SystemExit when building help In a recent Sphinx release, it started calling `sys.exit()` and that caused our whole build process to exit prematurely. --- hscommon/sphinxgen.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hscommon/sphinxgen.py b/hscommon/sphinxgen.py index e07f8bdc..018ba578 100644 --- a/hscommon/sphinxgen.py +++ b/hscommon/sphinxgen.py @@ -1,9 +1,9 @@ # Created By: Virgil Dupras # Created On: 2011-01-12 # Copyright 2014 Hardcoded Software (http://www.hardcoded.net) -# -# This software is licensed under the "BSD" License as described in the "LICENSE" file, -# which should be included with this package. The terms are also available at +# +# This software is licensed under the "BSD" License as described in the "LICENSE" file, +# which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license import os.path as op @@ -31,7 +31,7 @@ def tixgen(tixurl): def gen(basepath, destpath, changelogpath, tixurl, confrepl=None, confpath=None, changelogtmpl=None): """Generate sphinx docs with all bells and whistles. - + basepath: The base sphinx source path. destpath: The final path of html files changelogpath: The path to the changelog file to insert in changelog.rst. @@ -66,4 +66,7 @@ def gen(basepath, destpath, changelogpath, tixurl, confrepl=None, confpath=None, # missing dependencies which are in the virtualenv). Here, we do exactly what is done when # calling the command from bash. cmd = load_entry_point('Sphinx', 'console_scripts', 'sphinx-build') - cmd(['sphinx-build', basepath, destpath]) + try: + cmd(['sphinx-build', basepath, destpath]) + except SystemExit: + print("Sphinx called sys.exit(), but we're cancelling it because we don't acutally want to exit")