Skip to content

Commit

Permalink
Fix sphinx 1.2.2 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
epsy committed Feb 8, 2015
1 parent 9cfa114 commit a184dd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clize/_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@


class NoDupesObjectDirective(python.PyObject):
def get_ref_context(self):
try:
return self.env.ref_context
except AttributeError:
return self.env.temp_data

def add_target_and_index(self, name_cls, sig, signode):
modname = self.options.get(
'module', self.env.ref_context.get('py:module'))
'module', self.get_ref_context().get('py:module'))
fullname = (modname and modname + '.' or '') + name_cls[0]
# note target
if fullname not in self.state.document.ids:
Expand Down

0 comments on commit a184dd6

Please sign in to comment.