mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Close #7246: Drop special cross reference helper for exceptions, functions and methods
This commit is contained in:
parent
372813a137
commit
8e1934b6a1
2
CHANGES
2
CHANGES
@ -32,6 +32,8 @@ Incompatible changes
|
|||||||
to ``.. rst:role:: numref``
|
to ``.. rst:role:: numref``
|
||||||
* #6903: py domain: Non intended behavior is removed such as ``say_hello_``
|
* #6903: py domain: Non intended behavior is removed such as ``say_hello_``
|
||||||
links to ``.. py:function:: say_hello()``
|
links to ``.. py:function:: say_hello()``
|
||||||
|
* #7246: py domain: Drop special cross reference helper for exceptions,
|
||||||
|
functions and methods
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
----------
|
----------
|
||||||
|
@ -1110,14 +1110,6 @@ class PythonDomain(Domain):
|
|||||||
elif modname and classname and \
|
elif modname and classname and \
|
||||||
modname + '.' + classname + '.' + name in self.objects:
|
modname + '.' + classname + '.' + name in self.objects:
|
||||||
newname = modname + '.' + classname + '.' + name
|
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:
|
if newname is not None:
|
||||||
matches.append((newname, self.objects[newname]))
|
matches.append((newname, self.objects[newname]))
|
||||||
return matches
|
return matches
|
||||||
|
@ -206,18 +206,6 @@ def test_domain_py_find_obj(app, status, warning):
|
|||||||
[('NestedParentA.NestedChildA.subchild_1',
|
[('NestedParentA.NestedChildA.subchild_1',
|
||||||
('roles', 'nestedparenta-nestedchilda-subchild-1', 'method'))])
|
('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():
|
def test_get_full_qualified_name():
|
||||||
env = Mock(domaindata={})
|
env = Mock(domaindata={})
|
||||||
|
Loading…
Reference in New Issue
Block a user