Generate a fatal error on a Sphinx beta version that cannot be parsed.

This commit is contained in:
Chris Johns 2016-01-23 16:01:45 +11:00 committed by Amar Takhar
parent e5afcaa038
commit 0f5ccd4d6d

View File

@ -51,9 +51,11 @@ class linkcheck(BuildContext):
def check_sphinx_version(ctx, minver):
version = ctx.cmd_and_log(ctx.env.BIN_SPHINX_BUILD + ['--version']).split(" ")[-1:][0]
ver = tuple(map(int, version.split(".")))
version = ctx.cmd_and_log(ctx.env.BIN_SPHINX_BUILD + ['--version']).split(" ")[-1:][0].strip()
try:
ver = tuple(map(int, version.split(".")))
except:
ctx.fatal("Sphinx version cannot be checked: %s" % version)
if ver < minver:
ctx.fatal("Sphinx version is too old: %s" % ".".join(map(str, ver)))