diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-11-21 20:06:23 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2016-11-21 20:06:23 +0900 |
commit | 9690be4943887d70c4e4eb1cd309656f8831fb52 (patch) | |
tree | fc08f433650422849adda9442aa0b3d6c61b6bea /sphinx/ext/pngmath.py | |
parent | 36ca4ae393d2f6fc1c3cf3161bca60aa9975f70e (diff) | |
download | sphinx-git-9690be4943887d70c4e4eb1cd309656f8831fb52.tar.gz |
Fix imgmath: crashes on showing error messages if image generation failed
Diffstat (limited to 'sphinx/ext/pngmath.py')
-rw-r--r-- | sphinx/ext/pngmath.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py index d7660550e..655eb562f 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -218,10 +218,11 @@ def html_visit_displaymath(self, node): try: fname, depth = render_math(self, latex) except MathExtError as exc: - sm = nodes.system_message(str(exc), type='WARNING', level=2, + msg = text_type(exc) + sm = nodes.system_message(msg, type='WARNING', level=2, backrefs=[], source=node['latex']) sm.walkabout(self) - self.builder.warn('inline latex %r: ' % node['latex'] + str(exc)) + self.builder.warn('inline latex %r: ' % node['latex'] + msg) raise nodes.SkipNode self.body.append(self.starttag(node, 'div', CLASS='math')) self.body.append('<p>') |