mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
ues sphinx.util.force_decode if doc is not unicode.
This commit is contained in:
parent
b5f351064c
commit
acf1276d39
@ -51,6 +51,7 @@ from docutils.parsers.rst import directives
|
|||||||
from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
|
from sphinx.ext.graphviz import render_dot_html, render_dot_latex, \
|
||||||
render_dot_texinfo
|
render_dot_texinfo
|
||||||
from sphinx.pycode import ModuleAnalyzer
|
from sphinx.pycode import ModuleAnalyzer
|
||||||
|
from sphinx.util import force_decode
|
||||||
from sphinx.util.compat import Directive
|
from sphinx.util.compat import Directive
|
||||||
|
|
||||||
|
|
||||||
@ -161,7 +162,8 @@ class InheritanceGraph(object):
|
|||||||
if cls.__doc__:
|
if cls.__doc__:
|
||||||
enc = ModuleAnalyzer.for_module(cls.__module__).encoding
|
enc = ModuleAnalyzer.for_module(cls.__module__).encoding
|
||||||
doc = cls.__doc__.strip().split("\n")[0]
|
doc = cls.__doc__.strip().split("\n")[0]
|
||||||
doc = doc.decode(enc)
|
if not isinstance(doc, unicode):
|
||||||
|
doc = force_decode(doc, enc)
|
||||||
if doc:
|
if doc:
|
||||||
tooltip = '"%s"' % doc.replace('"', '\\"')
|
tooltip = '"%s"' % doc.replace('"', '\\"')
|
||||||
except Exception: # might raise AttributeError for strange classes
|
except Exception: # might raise AttributeError for strange classes
|
||||||
|
Loading…
Reference in New Issue
Block a user