Skip to content

Commit

Permalink
capture output from sphinx-build on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Aug 10, 2021
1 parent 48aea96 commit 44762ac
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/twisted/python/_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,18 +398,21 @@ def build(self, docDir, buildDir=None, version=""):

doctreeDir = buildDir.child("doctrees")

output = runCommand(
[
"sphinx-build",
"-q",
"-b",
"html",
"-d",
doctreeDir.path,
docDir.path,
buildDir.path,
]
).decode("utf-8")
try:
output = runCommand(
[
"sphinx-build",
"-q",
"-b",
"html",
"-d",
doctreeDir.path,
docDir.path,
buildDir.path,
]
).decode("utf-8")
except CalledProcessError as e:
raise Exception(f"stdout={e.stdout.decode()}\n\nstderr={e.stderr.decode()}")

# Delete the doctrees, as we don't want them after the docs are built
doctreeDir.remove()
Expand Down

0 comments on commit 44762ac

Please sign in to comment.