diff --git a/docs/source/conf.py b/docs/source/conf.py index e783b84f145a1..85acef8cc10a2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -204,7 +204,10 @@ from sphinx import addnodes -def patched_make_field(self, types, domain, items): +def patched_make_field(self, types, domain, items, **kw): + # `kw` catches `env=None` needed for newer sphinx while maingaining + # backwards compatibility when passed along further down! + # type: (List, unicode, Tuple) -> nodes.field def handle_item(fieldarg, content): par = nodes.paragraph() @@ -224,7 +227,7 @@ def handle_item(fieldarg, content): typename = typename.replace('float', 'python:float') typename = typename.replace('type', 'python:type') par.extend(self.make_xrefs(self.typerolename, domain, typename, - addnodes.literal_emphasis)) + addnodes.literal_emphasis, **kw)) else: par += fieldtype par += nodes.Text(')')