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:
Alex Neundorf 2013-12-22 20:46:57 +01:00 committed by Brad King
parent eb684157be
commit fb107d84d2
1 changed files with 6 additions and 1 deletions

View File

@ -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