Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit 990e73c3837c032235f4e3cb9075e766c639191d 1 parent 9e9e73a
@hsoft authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 hscommon/sphinxgen.py
View
13 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")
Please sign in to comment.
Something went wrong with that request. Please try again.