File: sphinx-build

package info (click to toggle)
xapian-bindings 1.4.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,436 kB
  • sloc: cpp: 379,853; python: 10,780; cs: 9,529; java: 6,949; sh: 4,629; perl: 4,435; makefile: 1,274; ruby: 1,028; php: 586; tcl: 246
file content (20 lines) | stat: -rw-r--r-- 793 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Wrapper to run Sphinx.  We avoid using sphinx-build because we need to use
# the Python3 version and it's hard to ensure we find the appropriate one.

# We can't easily put this code inline in the Makefile because you can't write
# try/except on a single-line in Python.

import sys
try:
    # Newer way, required as of Sphinx 2.0.
    from sphinx.cmd.build import build_main
    sys.exit(build_main(sys.argv[1:]))
except ImportError:
    # Sphinx < 1.7.0 didn't have sphinx.cmd.build.
    #
    # Prior to Sphinx 1.7.0, sphinx.main always skipped the first argument
    # passed.  In 1.7.0 it stopped doing this, but this fallback handling
    # should only be used for older versions so we no longer need to worry
    # about this.
    from sphinx import main
    sys.exit(main(sys.argv))