Close #7246: Drop special cross reference helper for exceptions, functions and methods

This commit is contained in:
Takeshi KOMIYA 2020-03-07 17:46:26 +09:00
parent 372813a137
commit 8e1934b6a1
3 changed files with 2 additions and 20 deletions

View File

@ -32,6 +32,8 @@ Incompatible changes
to ``.. rst:role:: numref``
* #6903: py domain: Non intended behavior is removed such as ``say_hello_``
links to ``.. py:function:: say_hello()``
* #7246: py domain: Drop special cross reference helper for exceptions,
functions and methods
Deprecated
----------

View File

@ -1110,14 +1110,6 @@ class PythonDomain(Domain):
elif modname and classname and \
modname + '.' + classname + '.' + name in self.objects:
newname = modname + '.' + classname + '.' + name
# special case: builtin exceptions have module "exceptions" set
elif type == 'exc' and '.' not in name and \
'exceptions.' + name in self.objects:
newname = 'exceptions.' + name
# special case: object methods
elif type in ('func', 'meth') and '.' not in name and \
'object.' + name in self.objects:
newname = 'object.' + name
if newname is not None:
matches.append((newname, self.objects[newname]))
return matches

View File

@ -206,18 +206,6 @@ def test_domain_py_find_obj(app, status, warning):
[('NestedParentA.NestedChildA.subchild_1',
('roles', 'nestedparenta-nestedchilda-subchild-1', 'method'))])
# special case: exceptions
assert (find_obj('exceptions', None, 'Exception', 'exc') ==
[('exceptions.Exception', ('module', 'exceptions-exception', 'exception'))])
assert (find_obj(None, None, 'Exception', 'exc') ==
[('exceptions.Exception', ('module', 'exceptions-exception', 'exception'))])
# special case: object
assert (find_obj('object', None, 'sum', 'func') ==
[('object.sum', ('module', 'object-sum', 'function'))])
assert (find_obj(None, None, 'sum', 'func') ==
[('object.sum', ('module', 'object-sum', 'function'))])
def test_get_full_qualified_name():
env = Mock(domaindata={})