blob: d3fe7026b1311bc5bcf13d237f042089f9286fa8 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001# -*- coding: utf-8 -*-
2"""
3 Sphinx - Python documentation toolchain
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
Georg Brandl2f277552010-08-03 12:31:59 +00006 :copyright: 2007-2010 by Georg Brandl.
Georg Brandl116aa622007-08-15 14:28:22 +00007 :license: Python license.
8"""
9
10import sys
Georg Brandl2f277552010-08-03 12:31:59 +000011import warnings
12
13# Get rid of UserWarnings reported by pkg_resources.
14warnings.filterwarnings('ignore', category=UserWarning, module='jinja2')
Georg Brandl116aa622007-08-15 14:28:22 +000015
16if __name__ == '__main__':
Guido van Rossumda27fd22007-08-17 00:24:54 +000017
Georg Brandlc3a29162013-10-13 22:19:49 +020018 if sys.version_info[:3] < (2, 4, 0) or sys.version_info[:3] > (3, 0, 0):
Georg Brandlbd84a582008-01-19 09:24:19 +000019 sys.stderr.write("""\
Georg Brandl18a364f2014-03-10 19:26:57 +010020Error: Sphinx needs to be executed with Python 2.4 or newer (not 3.x though).
Christian Heimes679db4a2008-01-18 09:56:22 +000021(If you run this from the Makefile, you can set the PYTHON variable
22to the path of an alternative interpreter executable, e.g.,
23``make html PYTHON=python2.5``).
Georg Brandlbd84a582008-01-19 09:24:19 +000024""")
Guido van Rossumda27fd22007-08-17 00:24:54 +000025 sys.exit(1)
26
Georg Brandl116aa622007-08-15 14:28:22 +000027 from sphinx import main
28 sys.exit(main(sys.argv))