Fix sphinx-build so that it runs with 2.x and 3.x but refuses to start with 3.x.

This commit is contained in:
Georg Brandl 2007-08-31 06:20:46 +00:00
parent 5a165584d7
commit fd5359c772
1 changed files with 6 additions and 7 deletions

View File

@ -11,13 +11,12 @@ import sys
if __name__ == '__main__':
if sys.version_info[:3] < (2, 5, 1):
print("""\
Error: Sphinx needs to be executed with Python 2.5.1 or newer
(If you run this from the Makefile, you can set the PYTHON variable
to the path of an alternative interpreter executable, e.g.,
``make html PYTHON=python2.5``).
""", file=sys.stderr)
if not (2, 5, 1) <= sys.version_info[:3] < (3, 0, 0):
sys.stderr.write("""\
Error: Sphinx needs to be executed with Python 2.5.1 or newer (not 3.0 though).
If you run this from the Makefile, you can set the PYTHON variable to the path
of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``.)
""")
sys.exit(1)
from sphinx import main