diff --git a/CHANGES b/CHANGES index d2d8b0985a5..97aed8095ee 100644 --- a/CHANGES +++ b/CHANGES @@ -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 -------- diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index cd02eaad563..1a3bd60c7bb 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -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: diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index 682ea76e199..5ba63d0e358 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -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, ()]))