summaryrefslogtreecommitdiff
path: root/sphinx/domains/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r--sphinx/domains/python.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
index 09d49681f..0187d0907 100644
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -1350,7 +1350,14 @@ class PythonDomain(Domain):
# always search in "refspecific" mode with the :any: role
matches = self.find_obj(env, modname, clsname, target, None, 1)
+ multiple_matches = len(matches) > 1
+
for name, obj in matches:
+
+ if multiple_matches and obj.aliased:
+ # Skip duplicated matches
+ continue
+
if obj[2] == 'module':
results.append(('py:mod',
self._make_module_refnode(builder, fromdocname,