Help: Fix Sphinx extension with docutils < 0.11
In older versions of python docutils "error_reporting" was not in the "utils" subpackage, so try the older location if the new one failed. Alex
This commit is contained in:
parent
eb684157be
commit
fb107d84d2
|
@ -14,7 +14,12 @@ import re
|
|||
|
||||
from docutils.parsers.rst import Directive, directives
|
||||
from docutils.transforms import Transform
|
||||
from docutils.utils.error_reporting import SafeString, ErrorString
|
||||
try:
|
||||
from docutils.utils.error_reporting import SafeString, ErrorString
|
||||
except ImportError:
|
||||
# error_reporting was not in utils before version 0.11:
|
||||
from docutils.error_reporting import SafeString, ErrorString
|
||||
|
||||
from docutils import io, nodes
|
||||
|
||||
from sphinx.directives import ObjectDescription
|
||||
|
|
Loading…
Reference in New Issue