Skip to content

Commit

Permalink
Fix patched_make_field for newer Sphinx versions. (pytorch#1275)
Browse files Browse the repository at this point in the history
Not sure since which version that change is needed, but using v1.5.5 here.
  • Loading branch information
lucasb-eyer authored and soumith committed Apr 17, 2017
1 parent a220f2c commit e447880
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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(')')
Expand Down

0 comments on commit e447880

Please sign in to comment.