Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd5359c

Browse files
committed
Fix sphinx-build so that it runs with 2.x and 3.x but refuses to start with 3.x.
1 parent 5a16558 commit fd5359c

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

Doc/tools/sphinx-build.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111

1212
if __name__ == '__main__':
1313

14-
if sys.version_info[:3] < (2, 5, 1):
15-
print("""\
16-
Error: Sphinx needs to be executed with Python 2.5.1 or newer
17-
(If you run this from the Makefile, you can set the PYTHON variable
18-
to the path of an alternative interpreter executable, e.g.,
19-
``make html PYTHON=python2.5``).
20-
""", file=sys.stderr)
14+
if not (2, 5, 1) <= sys.version_info[:3] < (3, 0, 0):
15+
sys.stderr.write("""\
16+
Error: Sphinx needs to be executed with Python 2.5.1 or newer (not 3.0 though).
17+
If you run this from the Makefile, you can set the PYTHON variable to the path
18+
of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``.)
19+
""")
2120
sys.exit(1)
2221

2322
from sphinx import main

0 commit comments

Comments
 (0)