diff options
author | Jean-François B <2589111+jfbu@users.noreply.github.com> | 2022-06-30 14:26:11 +0200 |
---|---|---|
committer | Jean-François B <2589111+jfbu@users.noreply.github.com> | 2022-06-30 15:00:16 +0200 |
commit | 80198e82aa9174802cb1eb30d69ce7fe98e24399 (patch) | |
tree | aa85c68296bd662543ccbcb17cc55e367e85c3c3 /sphinx/domains/python.py | |
parent | ac0fc4b7817389fb8b860d82537f69d9060aabae (diff) | |
parent | b9736f23484b16feef86208ab00dd947c54446ba (diff) | |
download | sphinx-git-80198e82aa9174802cb1eb30d69ce7fe98e24399.tar.gz |
Merge branch '5.x' into master
Resolved merge conflicts:
sphinx/ext/extlinks.py
sphinx/ext/napoleon/docstring.py
(and removed from the latter a now unused import for flake8 F401
compliance)
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r-- | sphinx/domains/python.py | 7 |
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, |