Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRam Rachum <ram@rachum.com>2020-06-14 00:46:19 +0300
committerRam Rachum <ram@rachum.com>2020-06-14 14:37:16 +0300
commit53c1dff91c0b7100e1ce1b51acbf0fffbc10cf9c (patch)
tree93bca0f98dfcf0f83f32987f898a7fbafe8f25dd /sphinx/ext/graphviz.py
parent0fc97a0b56d31f2703ff42dfe946e8d11d667909 (diff)
Fix exception causes all over the codebase
Diffstat (limited to 'sphinx/ext/graphviz.py')
-rw-r--r--sphinx/ext/graphviz.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index c21868a6f..4a8dd0a4d 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -256,7 +256,7 @@ def render_dot(self: SphinxTranslator, code: str, options: Dict,
return None, None
except CalledProcessError as exc:
raise GraphvizError(__('dot exited with error:\n[stderr]\n%r\n'
- '[stdout]\n%r') % (exc.stderr, exc.stdout))
+ '[stdout]\n%r') % (exc.stderr, exc.stdout)) from exc
def render_dot_html(self: HTMLTranslator, node: graphviz, code: str, options: Dict,
@@ -270,7 +270,7 @@ def render_dot_html(self: HTMLTranslator, node: graphviz, code: str, options: Di
fname, outfn = render_dot(self, code, options, format, prefix)
except GraphvizError as exc:
logger.warning(__('dot code %r: %s'), code, exc)
- raise nodes.SkipNode
+ raise nodes.SkipNode from exc
classes = [imgcls, 'graphviz'] + node.get('classes', [])
imgcls = ' '.join(filter(None, classes))
@@ -321,7 +321,7 @@ def render_dot_latex(self: LaTeXTranslator, node: graphviz, code: str,
fname, outfn = render_dot(self, code, options, 'pdf', prefix)
except GraphvizError as exc:
logger.warning(__('dot code %r: %s'), code, exc)
- raise nodes.SkipNode
+ raise nodes.SkipNode from exc
is_inline = self.is_inline(node)
@@ -358,7 +358,7 @@ def render_dot_texinfo(self: TexinfoTranslator, node: graphviz, code: str,
fname, outfn = render_dot(self, code, options, 'png', prefix)
except GraphvizError as exc:
logger.warning(__('dot code %r: %s'), code, exc)
- raise nodes.SkipNode
+ raise nodes.SkipNode from exc
if fname is not None:
self.body.append('@image{%s,,,[graphviz],png}\n' % fname[:-4])
raise nodes.SkipNode