@@ -29,11 +29,15 @@ u"""
from docutils.parsers.rst import directives
+import sphinx
from sphinx.domains.c import CObject as Base_CObject
from sphinx.domains.c import CDomain as Base_CDomain
__version__ = '1.0'
+# Get Sphinx version
+major, minor, patch = map(int, sphinx.__version__.split("."))
+
def setup(app):
app.override_domain(CDomain)
@@ -85,8 +89,14 @@ class CObject(Base_CObject):
indextext = self.get_index_text(name)
if indextext:
- self.indexnode['entries'].append(('single', indextext,
- targetname, '', None))
+ if major == 1 and minor < 4:
+ # indexnode's tuple changed in 1.4
+ # https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c
+ self.indexnode['entries'].append(
+ ('single', indextext, targetname, ''))
+ else:
+ self.indexnode['entries'].append(
+ ('single', indextext, targetname, '', None))
class CDomain(Base_CDomain):