diff options
author | Alex Neundorf <neundorf@kde.org> | 2013-12-22 19:46:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-12-23 15:17:01 (GMT) |
commit | fb107d84d2c79cc985b6bc72113db3ddac1a6584 (patch) | |
tree | 871c251ddb3d206783fb2092339b41a360285003 /Utilities | |
parent | eb684157bef60fe5668d284dbc97ee3b0930810c (diff) | |
download | CMake-fb107d84d2c79cc985b6bc72113db3ddac1a6584.zip CMake-fb107d84d2c79cc985b6bc72113db3ddac1a6584.tar.gz CMake-fb107d84d2c79cc985b6bc72113db3ddac1a6584.tar.bz2 |
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
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/Sphinx/cmake.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py index 146e1f6..1955e42 100644 --- a/Utilities/Sphinx/cmake.py +++ b/Utilities/Sphinx/cmake.py @@ -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 |