Skip to content
Snippets Groups Projects
Commit 76231468 authored by Harry Jeffery's avatar Harry Jeffery
Browse files

Refs #11054 Gracefully fail if dot unavailable

parent 36b10d8c
No related merge requests found
......@@ -51,7 +51,7 @@ def main(sysarg):
if DIAGRAMS_DIR != "":
os.environ["DIAGRAMS_DIR"] = DIAGRAMS_DIR
if DOT_EXECUTABLE != "":
if os.path.isfile(DOT_EXECUTABLE):
os.environ["DOT_EXECUTABLE"] = DOT_EXECUTABLE
# Arguments for main
......
......@@ -61,7 +61,9 @@ class DiagramDirective(BaseDirective):
try:
dot_executable = os.environ["DOT_EXECUTABLE"]
except:
raise RuntimeError("The '.. diagram::' directive requires a DOT_EXECUTABLE environment variable to be set.")
self.add_rst(".. figure:: /images/ImageNotFound.png\n\n" +
" graphviz not found - diagram could not be rendered.")
return []
#Make sure we have an output directory
if not os.path.exists(out_dir):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment