if code is not unicode, change to unicode in ext/graphviz.py.

This commit is contained in:
shirou 2014-08-14 20:31:36 +09:00
parent d01efde712
commit 1e0fd180b1

View File

@ -139,6 +139,11 @@ class GraphvizSimple(Directive):
def render_dot(self, code, options, format, prefix='graphviz'):
"""Render graphviz code into a PNG or PDF output file."""
# if code is not unicode, convert to unicode. it is expected utf-8
if not isinstance(code, text_type):
code = code.decode('utf-8')
hashkey = (code + str(options) + \
str(self.builder.config.graphviz_dot) + \
str(self.builder.config.graphviz_dot_args)