Skip to content

Commit

Permalink
Fix #9697: An index entry with parens was registered for py:method
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Oct 3, 2021
1 parent 0424210 commit b920418
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -39,6 +39,8 @@ Bugs fixed
* #9649: HTML search: when objects have the same name but in different domains,
return all of them as result instead of just one.
* #9678: linkcheck: file extension was shown twice in warnings
* #9697: py domain: An index entry with parens was registered for ``py:method``
directive with ``:property:`` option

Testing
--------
Expand Down
2 changes: 1 addition & 1 deletion sphinx/domains/python.py
Expand Up @@ -769,7 +769,7 @@ def get_index_text(self, modname: str, name_cls: Tuple[str, str]) -> str:
if 'classmethod' in self.options:
return _('%s() (%s class method)') % (methname, clsname)
elif 'property' in self.options:
return _('%s() (%s property)') % (methname, clsname)
return _('%s (%s property)') % (methname, clsname)
elif 'staticmethod' in self.options:
return _('%s() (%s static method)') % (methname, clsname)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_domain_py.py
Expand Up @@ -732,7 +732,7 @@ def test_pymethod_options(app):

# :property:
assert_node(doctree[1][1][8], addnodes.index,
entries=[('single', 'meth5() (Class property)', 'Class.meth5', '', None)])
entries=[('single', 'meth5 (Class property)', 'Class.meth5', '', None)])
assert_node(doctree[1][1][9], ([desc_signature, ([desc_annotation, "property "],
[desc_name, "meth5"])],
[desc_content, ()]))
Expand Down

0 comments on commit b920418

Please sign in to comment.