Skip to content

Commit

Permalink
Merge pull request #9698 from tk0miya/9697_property_with_parens
Browse files Browse the repository at this point in the history
Fix #9697: An index entry with parens was registered for py:method
  • Loading branch information
tk0miya committed Oct 9, 2021
2 parents f050a77 + 2a7775d commit 7da94ee
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 @@ -59,6 +59,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 @@ -796,7 +796,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 @@ -756,7 +756,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_sig_space)],
[desc_name, "meth5"])],
[desc_content, ()]))
Expand Down

0 comments on commit 7da94ee

Please sign in to comment.