Fix error messages when Sphinx version cannot be checked.

This is kind of a dual-check since it checks for the version while simultaneously
checking to see if Sphinx exists on the system.

Changed the error messages to be clear on the error and removed a reference to
version which cannot be set due to the check failure.

Reported by: Shashvat Jain
This commit is contained in:
Amar Takhar 2018-12-05 14:31:53 -05:00
parent 5628d8b99a
commit a46b0250e5

View File

@ -119,9 +119,9 @@ def check_sphinx_version(ctx, minver):
try:
ver = tuple(map(int, re.split('[\D]', version)))
except:
ctx.fatal("Sphinx version cannot be checked")
ctx.fatal("Sphinx version cannot be checked or Sphinx is not installed")
except:
ctx.fatal("Sphinx version cannot be checked: %s" % version)
ctx.fatal("Sphinx version cannot be checked or Sphinx is not installed")
if ver < minver:
ctx.fatal("Sphinx version is too old: %s" % ".".join(map(str, ver)))
return ver