Skip to content

Commit 1e5c835

Browse files
EricPobotddemidov
authored andcommitted
Sphinx py3 (#309)
* makes the Sphinx process work with Python3 in environments where Python2 is the default interpreter
1 parent 770ae2a commit 1e5c835

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line.
55
SPHINXOPTS =
6-
SPHINXBUILD = sphinx-build
6+
SPHINXBUILD = ./sphinx3-build
77
PAPER =
88
BUILDDIR = _build
99

docs/sphinx3-build

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Same as /usr/bin/sphinx-build but with different
5+
interpreter
6+
7+
Source: http://stackoverflow.com/a/24675806
8+
"""
9+
10+
import sys
11+
12+
if __name__ == '__main__':
13+
from sphinx import main, make_main
14+
if sys.argv[1:2] == ['-M']:
15+
sys.exit(make_main(sys.argv))
16+
else:
17+
sys.exit(main(sys.argv))
18+

0 commit comments

Comments
 (0)